Package org.apache.druid.query.scan
Class SettableCursorColumnSelectorFactory
java.lang.Object
org.apache.druid.query.scan.SettableCursorColumnSelectorFactory
- All Implemented Interfaces:
Expr.InputBindingInspector,ColumnInspector,ColumnSelectorFactory
@NotThreadSafe
public class SettableCursorColumnSelectorFactory
extends Object
implements ColumnSelectorFactory
A column selector factory, that represents the column values from multiple underlying cursors. It essentially
wraps over the multiple cursors and can be passed to methods that expect column value selector from a single cursor.
It is the duty of the caller to know when to switch from one cursor to another
It is expected to work correctly if the individual cursors have the same corresponding columns, columnTypes,
and column capabilities since the usual pattern throughout the code is to cache these values and
assume they are fixed throughout.
-
Constructor Summary
ConstructorsConstructorDescriptionSettableCursorColumnSelectorFactory(Supplier<Cursor> cursorSupplier, RowSignature rowSignature) -
Method Summary
Modifier and TypeMethodDescriptiongetColumnCapabilities(String column) Return column capabilities from the signature.Since we don't know all the cursors beforehand, we can't reconcile their row id suppliers to provide one heremakeColumnValueSelector(String columnName) CreateColumnValueSelectorfor the give column namemakeDimensionSelector(DimensionSpec dimensionSpec) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.segment.ColumnInspector
getTypeMethods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
Constructor Details
-
SettableCursorColumnSelectorFactory
public SettableCursorColumnSelectorFactory(Supplier<Cursor> cursorSupplier, RowSignature rowSignature)
-
-
Method Details
-
makeDimensionSelector
- Specified by:
makeDimensionSelectorin interfaceColumnSelectorFactory
-
makeColumnValueSelector
CreateColumnValueSelectorfor the give column name- Specified by:
makeColumnValueSelectorin interfaceColumnSelectorFactory
-
getColumnCapabilities
Return column capabilities from the signature. This returns the capabilities with the minimal assumptions. For example, one cursor can have capabilities with multivalues set to FALSE, while other can have it set to TRUE Creating the capabilites from the signature would leave the state undefined. If the caller has more knowledge about all the cursors that will get created, the caller can subclass and override the function with that information- Specified by:
getColumnCapabilitiesin interfaceColumnInspector- Specified by:
getColumnCapabilitiesin interfaceColumnSelectorFactory- Parameters:
column- column name- Returns:
- capabilities, or null
-
getRowIdSupplier
Since we don't know all the cursors beforehand, we can't reconcile their row id suppliers to provide one here- Specified by:
getRowIdSupplierin interfaceColumnSelectorFactory
-