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 aVectorColumnProcessorFactory
and 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 ColumnCapabilities
getColumnCapabilities(String column)
Returns capabilities of a particular column, or null if the column doesn't exist.default int
getMaxVectorSize()
Returns the maximum vector size for theVectorCursor
that generated this object.ReadableVectorInspector
getReadableVectorInspector()
Returns aReadableVectorInspector
for theVectorCursor
that generated this object.MultiValueDimensionVectorSelector
makeMultiValueDimensionSelector(DimensionSpec dimensionSpec)
Returns a dictionary encoded, string-typed, multi-value-per-row column selector.VectorObjectSelector
makeObjectSelector(String column)
Returns an object selector.SingleValueDimensionVectorSelector
makeSingleValueDimensionSelector(DimensionSpec dimensionSpec)
Returns a dictionary encoded, string-typed, single-value-per-row column selector.VectorValueSelector
makeValueSelector(String column)
Returns a primitive column selector.-
Methods inherited from interface org.apache.druid.segment.ColumnInspector
getColumnCapabilitiesWithDefault, 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 aReadableVectorInspector
for theVectorCursor
that generated this object.
-
getMaxVectorSize
default int getMaxVectorSize()
Returns the maximum vector size for theVectorCursor
that 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 aVectorColumnProcessorFactory
and 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 aVectorColumnProcessorFactory
and 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 aVectorColumnProcessorFactory
and 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 ofSingleValueDimensionVectorSelector
when 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 aVectorColumnProcessorFactory
and 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:
getColumnCapabilities
in interfaceColumnInspector
- Parameters:
column
- column name- Returns:
- capabilities, or null if the column doesn't exist.
-
-