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
Constructors Constructor Description SettableCursorColumnSelectorFactory(Supplier<Cursor> cursorSupplier, RowSignature rowSignature)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnCapabilitiesgetColumnCapabilities(String column)Return column capabilities from the signature.RowIdSuppliergetRowIdSupplier()Since we don't know all the cursors beforehand, we can't reconcile their row id suppliers to provide one hereColumnValueSelectormakeColumnValueSelector(String columnName)CreateColumnValueSelectorfor the give column nameDimensionSelectormakeDimensionSelector(DimensionSpec dimensionSpec)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.ColumnInspector
getType
-
Methods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
-
-
-
Constructor Detail
-
SettableCursorColumnSelectorFactory
public SettableCursorColumnSelectorFactory(Supplier<Cursor> cursorSupplier, RowSignature rowSignature)
-
-
Method Detail
-
makeDimensionSelector
public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec)
- Specified by:
makeDimensionSelectorin interfaceColumnSelectorFactory
-
makeColumnValueSelector
public ColumnValueSelector makeColumnValueSelector(String columnName)
CreateColumnValueSelectorfor the give column name- Specified by:
makeColumnValueSelectorin interfaceColumnSelectorFactory
-
getColumnCapabilities
@Nullable public ColumnCapabilities getColumnCapabilities(String column)
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
@Nullable public RowIdSupplier 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
-
-