public interface DimensionSelector extends ColumnValueSelector<Object>, DimensionDictionarySelector, HotLoopCallee
org.apache.druid.segment.vector.SingleValueDimensionVectorSelector, a vectorized version
,
org.apache.druid.segment.vector.MultiValueDimensionVectorSelector, another vectorized version
Modifier and Type | Interface and Description |
---|---|
static class |
DimensionSelector.NullDimensionSelectorHolder
This class not a public API.
|
EMPTY_ARRAY
CARDINALITY_UNKNOWN
Modifier and Type | Method and Description |
---|---|
static DimensionSelector |
constant(String value) |
static DimensionSelector |
constant(String value,
ExtractionFn extractionFn) |
default Object |
defaultGetObject()
Converts the current result of
getRow() into null, if the row is empty, a String, if the row has size 1,
or a String[] array, if the row has size > 1, using DimensionDictionarySelector.lookupName(int) . |
default double |
getDouble()
Deprecated.
This method is marked as deprecated in DimensionSelector to minimize the probability of accidental
calling. "Polymorphism" of DimensionSelector should be used only when operating on
ColumnValueSelector
objects. |
default float |
getFloat()
Deprecated.
This method is marked as deprecated in DimensionSelector to minimize the probability of accidental
calling. "Polymorphism" of DimensionSelector should be used only when operating on
ColumnValueSelector
objects. |
default long |
getLong()
Deprecated.
This method is marked as deprecated in DimensionSelector to minimize the probability of accidental
calling. "Polymorphism" of DimensionSelector should be used only when operating on
ColumnValueSelector
objects. |
IndexedInts |
getRow()
Returns the indexed values at the current position in this DimensionSelector.
|
static boolean |
isNilSelector(DimensionSelector selector)
Checks if the given selector constantly returns null.
|
default boolean |
isNull()
Deprecated.
|
ValueMatcher |
makeValueMatcher(com.google.common.base.Predicate<String> predicate) |
ValueMatcher |
makeValueMatcher(String value) |
static DimensionSelector |
multiConstant(List<String> values) |
static DimensionSelector |
multiConstant(List<String> values,
ExtractionFn extractionFn) |
static DimensionSelector |
nilSelector() |
static Object |
rowToObject(IndexedInts row,
DimensionDictionarySelector selector)
Converts a particular
IndexedInts to an Object in a standard way, assuming each element in the IndexedInts
is a dictionary ID that can be resolved with the provided selector. |
inspectRuntimeShape
classOfObject, getObject
getValueCardinality, idLookup, lookupName, lookupNameUtf8, nameLookupPossibleInAdvance, supportsLookupNameUtf8
@CalledFromHotLoop IndexedInts getRow()
IndexedInts
object could generally be reused inside the implementation of
DimensionSelector, i. e. this method could always return the same object for the same selector. Users
of this API, such as Aggregator.aggregate()
, BufferAggregator.aggregate(java.nio.ByteBuffer, int)
, AggregateCombiner.reset(org.apache.druid.segment.ColumnValueSelector)
,
AggregateCombiner.fold(org.apache.druid.segment.ColumnValueSelector)
should be prepared for that and not storing the object
returned from this method in their state, assuming that the object will remain unchanged even when the position of
the selector changes. This may not be the case.ValueMatcher makeValueMatcher(@Nullable String value)
value
- nullable dimension valueValueMatcher makeValueMatcher(com.google.common.base.Predicate<String> predicate)
@Deprecated default float getFloat()
ColumnValueSelector
objects.getFloat
in interface BaseFloatColumnValueSelector
@Deprecated default double getDouble()
ColumnValueSelector
objects.getDouble
in interface BaseDoubleColumnValueSelector
@Deprecated default long getLong()
ColumnValueSelector
objects.getLong
in interface BaseLongColumnValueSelector
@Deprecated default boolean isNull()
BaseNullableColumnValueSelector
BaseLongColumnValueSelector.getLong()
, BaseDoubleColumnValueSelector.getDouble()
and BaseFloatColumnValueSelector.getFloat()
must check this method first, or else they may improperly
use placeholder values returned by the primitive get methods.
Users of BaseObjectColumnValueSelector.getObject()
should not call this method. Instead, call "getObject"
and check if it is null.isNull
in interface BaseNullableColumnValueSelector
@Nullable default Object defaultGetObject()
getRow()
into null, if the row is empty, a String, if the row has size 1,
or a String[] array, if the row has size > 1, using DimensionDictionarySelector.lookupName(int)
.
This method is not the default implementation of BaseObjectColumnValueSelector.getObject()
to minimize the chance that implementations
"forget" to override it with more optimized version.@Nullable static Object rowToObject(IndexedInts row, DimensionDictionarySelector selector)
IndexedInts
to an Object in a standard way, assuming each element in the IndexedInts
is a dictionary ID that can be resolved with the provided selector.static DimensionSelector nilSelector()
static DimensionSelector constant(@Nullable String value)
static DimensionSelector constant(@Nullable String value, @Nullable ExtractionFn extractionFn)
static DimensionSelector multiConstant(@Nullable List<String> values)
static DimensionSelector multiConstant(@Nullable List<String> values, @Nullable ExtractionFn extractionFn)
static boolean isNilSelector(DimensionSelector selector)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.