Package org.apache.druid.segment.vector
Interface VectorColumnSelectorFactory
-
- All Superinterfaces:
ColumnInspector,Expr.InputBindingInspector
- All Known Implementing Classes:
QueryableIndexVectorColumnSelectorFactory
public interface VectorColumnSelectorFactory extends ColumnInspector
A class that comes fromVectorCursor.getColumnSelectorFactory()and is used to create vector selectors. If you need to write code that adapts to different input types, you should write aVectorColumnProcessorFactoryand use one of theColumnProcessors.makeVectorProcessor(java.lang.String, org.apache.druid.segment.VectorColumnProcessorFactory<T>, org.apache.druid.segment.vector.VectorColumnSelectorFactory)functions instead of using this class.- See Also:
the non-vectorized version.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ColumnCapabilitiesgetColumnCapabilities(String column)Returns capabilities of a particular column, or null if the column doesn't exist.default intgetMaxVectorSize()Returns the maximum vector size for theVectorCursorthat generated this object.ReadableVectorInspectorgetReadableVectorInspector()Returns aReadableVectorInspectorfor theVectorCursorthat generated this object.MultiValueDimensionVectorSelectormakeMultiValueDimensionSelector(DimensionSpec dimensionSpec)Returns a dictionary encoded, string-typed, multi-value-per-row column selector.VectorObjectSelectormakeObjectSelector(String column)Returns an object selector.SingleValueDimensionVectorSelectormakeSingleValueDimensionSelector(DimensionSpec dimensionSpec)Returns a dictionary encoded, string-typed, single-value-per-row column selector.VectorValueSelectormakeValueSelector(String column)Returns a primitive column selector.-
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
-
-
-
-
Method Detail
-
getReadableVectorInspector
ReadableVectorInspector getReadableVectorInspector()
Returns aReadableVectorInspectorfor theVectorCursorthat generated this object.
-
getMaxVectorSize
default int getMaxVectorSize()
Returns the maximum vector size for theVectorCursorthat generated this object.- See Also:
VectorSizeInspector.getMaxVectorSize()
-
makeSingleValueDimensionSelector
SingleValueDimensionVectorSelector makeSingleValueDimensionSelector(DimensionSpec dimensionSpec)
Returns a dictionary encoded, string-typed, single-value-per-row column selector. Should only be called on columns wheregetColumnCapabilities(java.lang.String)indicates they return STRING, or on nonexistent columns. Since the selector created with this method operates directly on the dictionary encoded input, STRING values must be translated from the dictionary id for a given row value usingDimensionDictionarySelector.lookupName(int), but this selector can prove optimal for operations which can be done directly on the underlying dictionary ids, such as grouping within a segment. If you need to write code that adapts to different input types, you should write aVectorColumnProcessorFactoryand use one of theColumnProcessors.makeVectorProcessor(java.lang.String, org.apache.druid.segment.VectorColumnProcessorFactory<T>, org.apache.druid.segment.vector.VectorColumnSelectorFactory)functions instead of using this method.
-
makeMultiValueDimensionSelector
MultiValueDimensionVectorSelector makeMultiValueDimensionSelector(DimensionSpec dimensionSpec)
Returns a dictionary encoded, string-typed, multi-value-per-row column selector. Should only be called on columns wheregetColumnCapabilities(java.lang.String)indicates they return STRING. UnlikemakeSingleValueDimensionSelector(org.apache.druid.query.dimension.DimensionSpec), this should not be called on nonexistent columns. If you need to write code that adapts to different input types, you should write aVectorColumnProcessorFactoryand use one of theColumnProcessors.makeVectorProcessor(java.lang.String, org.apache.druid.segment.VectorColumnProcessorFactory<T>, org.apache.druid.segment.vector.VectorColumnSelectorFactory)functions instead of using this method.
-
makeValueSelector
VectorValueSelector makeValueSelector(String column)
Returns a primitive column selector. Should only be called on columns wheregetColumnCapabilities(java.lang.String)indicates they return DOUBLE, FLOAT, or LONG, or on nonexistent columns. If you need to write code that adapts to different input types, you should write aVectorColumnProcessorFactoryand use one of theColumnProcessors.makeVectorProcessor(java.lang.String, org.apache.druid.segment.VectorColumnProcessorFactory<T>, org.apache.druid.segment.vector.VectorColumnSelectorFactory)functions instead of using this method.
-
makeObjectSelector
VectorObjectSelector makeObjectSelector(String column)
Returns an object selector. Should only be called on columns wheregetColumnCapabilities(java.lang.String)indicates that they return STRING, ARRAY, or COMPLEX, or on nonexistent columns. For STRING, this is needed if values are not dictionary encoded, such as computed virtual columns, or can optionally be used in place ofSingleValueDimensionVectorSelectorwhen using the dictionary isn't helpful. Currently, this should only be called on single valued STRING inputs (multi-value STRING vector object selector is not yet implemented). If you need to write code that adapts to different input types, you should write aVectorColumnProcessorFactoryand use one of theColumnProcessors.makeVectorProcessor(java.lang.String, org.apache.druid.segment.VectorColumnProcessorFactory<T>, org.apache.druid.segment.vector.VectorColumnSelectorFactory)functions instead of using this method.
-
getColumnCapabilities
@Nullable ColumnCapabilities getColumnCapabilities(String column)
Returns capabilities of a particular column, or null if the column doesn't exist. Unlike ColumnSelectorFactory, null does not potentially indicate a dynamically discovered column.- Specified by:
getColumnCapabilitiesin interfaceColumnInspector- Parameters:
column- column name- Returns:
- capabilities, or null if the column doesn't exist.
-
-