Package org.apache.druid.frame.processor
Class MultiColumnSelectorFactory
- java.lang.Object
-
- org.apache.druid.frame.processor.MultiColumnSelectorFactory
-
- All Implemented Interfaces:
Expr.InputBindingInspector
,ColumnInspector
,ColumnSelectorFactory
public class MultiColumnSelectorFactory extends Object implements ColumnSelectorFactory
AColumnSelectorFactory
that wraps multipleColumnSelectorFactory
and delegates to one of them at any given time. The identity of the delegated-to factory is changed by callingsetCurrentFactory(int)
.
-
-
Constructor Summary
Constructors Constructor Description MultiColumnSelectorFactory(List<Supplier<ColumnSelectorFactory>> factorySuppliers, RowSignature signature)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnCapabilities
getColumnCapabilities(String column)
Returns capabilities of a particular column, if known.ColumnValueSelector
makeColumnValueSelector(String columnName)
Returns ColumnValueSelector corresponding to the given column name, orNilColumnValueSelector
if the column with such name is absent.DimensionSelector
makeDimensionSelector(DimensionSpec dimensionSpec)
void
setCurrentFactory(int currentFactory)
MultiColumnSelectorFactory
withRowMemoryAndSignatureColumns()
Create a copy that includesFrameColumnSelectorFactory.ROW_SIGNATURE_COLUMN
andFrameColumnSelectorFactory.ROW_MEMORY_COLUMN
to potentially enable direct row memory copying.-
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
getColumnCapabilitiesWithDefault, getType
-
Methods inherited from interface org.apache.druid.segment.ColumnSelectorFactory
getRowIdSupplier
-
Methods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
-
-
-
Constructor Detail
-
MultiColumnSelectorFactory
public MultiColumnSelectorFactory(List<Supplier<ColumnSelectorFactory>> factorySuppliers, RowSignature signature)
-
-
Method Detail
-
setCurrentFactory
public void setCurrentFactory(int currentFactory)
-
withRowMemoryAndSignatureColumns
public MultiColumnSelectorFactory withRowMemoryAndSignatureColumns()
Create a copy that includesFrameColumnSelectorFactory.ROW_SIGNATURE_COLUMN
andFrameColumnSelectorFactory.ROW_MEMORY_COLUMN
to potentially enable direct row memory copying. If these columns don't actually exist in the underlying column selector factories, they'll be ignored, so it's OK to use this method even if the columns may not exist.
-
makeDimensionSelector
public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec)
- Specified by:
makeDimensionSelector
in interfaceColumnSelectorFactory
-
makeColumnValueSelector
public ColumnValueSelector makeColumnValueSelector(String columnName)
Description copied from interface:ColumnSelectorFactory
Returns ColumnValueSelector corresponding to the given column name, orNilColumnValueSelector
if the column with such name is absent.- Specified by:
makeColumnValueSelector
in interfaceColumnSelectorFactory
-
getColumnCapabilities
@Nullable public ColumnCapabilities getColumnCapabilities(String column)
Description copied from interface:ColumnSelectorFactory
Returns capabilities of a particular column, if known. May be null if the column doesn't exist, or if the column does exist but the capabilities are unknown. The latter is possible with dynamically discovered columns.- Specified by:
getColumnCapabilities
in interfaceColumnInspector
- Specified by:
getColumnCapabilities
in interfaceColumnSelectorFactory
- Parameters:
column
- column name- Returns:
- capabilities, or null
-
-