Package org.apache.druid.segment.vector
Class RemapVectorColumnSelectorFactory
java.lang.Object
org.apache.druid.segment.vector.RemapVectorColumnSelectorFactory
- All Implemented Interfaces:
Expr.InputBindingInspector,ColumnInspector,VectorColumnSelectorFactory
-
Constructor Summary
ConstructorsConstructorDescriptionRemapVectorColumnSelectorFactory(VectorColumnSelectorFactory delegate, Map<String, String> remap) -
Method Summary
Modifier and TypeMethodDescriptiongetColumnCapabilities(String column) Returns capabilities of a particular column, or null if the column doesn't exist.intReturns the maximum vector size for theVectorCursorthat generated this object.Returns aReadableVectorInspectorfor theVectorCursorthat generated this object.Get theExpressionTypefrom the backing store for a given identifier (this is likely a column, but could be other things depending on the backing adapter)makeGroupByVectorColumnSelector(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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
Constructor Details
-
RemapVectorColumnSelectorFactory
public RemapVectorColumnSelectorFactory(VectorColumnSelectorFactory delegate, Map<String, String> remap)
-
-
Method Details
-
getReadableVectorInspector
Description copied from interface:VectorColumnSelectorFactoryReturns aReadableVectorInspectorfor theVectorCursorthat generated this object.- Specified by:
getReadableVectorInspectorin interfaceVectorColumnSelectorFactory
-
getMaxVectorSize
public int getMaxVectorSize()Description copied from interface:VectorColumnSelectorFactoryReturns the maximum vector size for theVectorCursorthat generated this object.- Specified by:
getMaxVectorSizein interfaceVectorColumnSelectorFactory- See Also:
-
makeSingleValueDimensionSelector
public SingleValueDimensionVectorSelector makeSingleValueDimensionSelector(DimensionSpec dimensionSpec) Description copied from interface:VectorColumnSelectorFactoryReturns a dictionary encoded, string-typed, single-value-per-row column selector. Should only be called on columns whereVectorColumnSelectorFactory.getColumnCapabilities(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.- Specified by:
makeSingleValueDimensionSelectorin interfaceVectorColumnSelectorFactory
-
makeMultiValueDimensionSelector
public MultiValueDimensionVectorSelector makeMultiValueDimensionSelector(DimensionSpec dimensionSpec) Description copied from interface:VectorColumnSelectorFactoryReturns a dictionary encoded, string-typed, multi-value-per-row column selector. Should only be called on columns whereVectorColumnSelectorFactory.getColumnCapabilities(java.lang.String)indicates they return STRING. UnlikeVectorColumnSelectorFactory.makeSingleValueDimensionSelector(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.- Specified by:
makeMultiValueDimensionSelectorin interfaceVectorColumnSelectorFactory
-
makeValueSelector
Description copied from interface:VectorColumnSelectorFactoryReturns a primitive column selector. Should only be called on columns whereVectorColumnSelectorFactory.getColumnCapabilities(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.- Specified by:
makeValueSelectorin interfaceVectorColumnSelectorFactory
-
makeObjectSelector
Description copied from interface:VectorColumnSelectorFactoryReturns an object selector. Should only be called on columns whereVectorColumnSelectorFactory.getColumnCapabilities(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.- Specified by:
makeObjectSelectorin interfaceVectorColumnSelectorFactory
-
getColumnCapabilities
Description copied from interface:VectorColumnSelectorFactoryReturns 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- Specified by:
getColumnCapabilitiesin interfaceVectorColumnSelectorFactory- Parameters:
column- column name- Returns:
- capabilities, or null if the column doesn't exist.
-
getType
Description copied from interface:Expr.InputBindingInspectorGet theExpressionTypefrom the backing store for a given identifier (this is likely a column, but could be other things depending on the backing adapter)- Specified by:
getTypein interfaceColumnInspector- Specified by:
getTypein interfaceExpr.InputBindingInspector
-
makeGroupByVectorColumnSelector
public GroupByVectorColumnSelector makeGroupByVectorColumnSelector(String column, DeferExpressionDimensions deferExpressionDimensions) Description copied from interface:VectorColumnSelectorFactoryReturns a group-by selector. Allows columns to control their own grouping behavior.- Specified by:
makeGroupByVectorColumnSelectorin interfaceVectorColumnSelectorFactory- Parameters:
column- column namedeferExpressionDimensions- active value ofGroupByQueryConfig.CTX_KEY_DEFER_EXPRESSION_DIMENSIONS
-