Package org.apache.druid.segment.vector
Interface VectorColumnSelectorFactory
- All Superinterfaces:
ColumnInspector,Expr.InputBindingInspector
- All Known Implementing Classes:
QueryableIndexVectorColumnSelectorFactory,RemapVectorColumnSelectorFactory
A class that comes from
VectorCursor.getColumnSelectorFactory() and is used to create vector selectors.
If you need to write code that adapts to different input types, you should write a
VectorColumnProcessorFactory and use one of the
ColumnProcessors.makeVectorProcessor(java.lang.String, org.apache.druid.segment.VectorColumnProcessorFactory<T>, org.apache.druid.segment.vector.VectorColumnSelectorFactory) functions instead of using this class.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetColumnCapabilities(String column) Returns capabilities of a particular column, or null if the column doesn't exist.default intReturns the maximum vector size for theVectorCursorthat generated this object.Returns aReadableVectorInspectorfor theVectorCursorthat generated this object.default GroupByVectorColumnSelectormakeGroupByVectorColumnSelector(String column, DeferExpressionDimensions deferExpressionDimensions) Returns a group-by selector.makeMultiValueDimensionSelector(DimensionSpec dimensionSpec) Returns a dictionary encoded, string-typed, multi-value-per-row column selector.makeObjectSelector(String column) Returns an object selector.makeSingleValueDimensionSelector(DimensionSpec dimensionSpec) Returns a dictionary encoded, string-typed, single-value-per-row column selector.makeValueSelector(String column) Returns a primitive column selector.Methods 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
-
Method Details
-
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:
-
makeSingleValueDimensionSelector
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
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
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
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
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.
-
makeGroupByVectorColumnSelector
default GroupByVectorColumnSelector makeGroupByVectorColumnSelector(String column, DeferExpressionDimensions deferExpressionDimensions) Returns a group-by selector. Allows columns to control their own grouping behavior.- Parameters:
column- column namedeferExpressionDimensions- active value ofGroupByQueryConfig.CTX_KEY_DEFER_EXPRESSION_DIMENSIONS
-