Package org.apache.druid.segment
Class AbstractDimensionSelector
- java.lang.Object
-
- org.apache.druid.segment.AbstractDimensionSelector
-
- All Implemented Interfaces:
HotLoopCallee
,BaseDoubleColumnValueSelector
,BaseFloatColumnValueSelector
,BaseLongColumnValueSelector
,BaseNullableColumnValueSelector
,BaseObjectColumnValueSelector<Object>
,ColumnValueSelector<Object>
,DimensionDictionarySelector
,DimensionSelector
- Direct Known Subclasses:
PossiblyNullDimensionSelector
public abstract class AbstractDimensionSelector extends Object implements DimensionSelector
An abstract class that provides an implementation ofgetObject()
. Don't extend this abstract class if you could provide a more efficient implementation for those methods, implementDimensionSelector
directly then.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.segment.DimensionSelector
DimensionSelector.NullDimensionSelectorHolder
-
-
Field Summary
-
Fields inherited from interface org.apache.druid.segment.ColumnValueSelector
EMPTY_ARRAY
-
Fields inherited from interface org.apache.druid.segment.DimensionDictionarySelector
CARDINALITY_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description AbstractDimensionSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getObject()
Returns the currently-selected object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.BaseObjectColumnValueSelector
classOfObject
-
Methods inherited from interface org.apache.druid.segment.DimensionDictionarySelector
getValueCardinality, idLookup, lookupName, lookupNameUtf8, nameLookupPossibleInAdvance, supportsLookupNameUtf8
-
Methods inherited from interface org.apache.druid.segment.DimensionSelector
defaultGetObject, getDouble, getFloat, getLong, getRow, isNull, makeValueMatcher, makeValueMatcher
-
Methods inherited from interface org.apache.druid.query.monomorphicprocessing.HotLoopCallee
inspectRuntimeShape
-
-
-
-
Method Detail
-
getObject
@Nullable public Object getObject()
Description copied from interface:BaseObjectColumnValueSelector
Returns the currently-selected object. The behavior of this method depends on the type of selector, which can be determined by callingColumnSelectorFactory.getColumnCapabilities(String)
on the sameColumnSelectorFactory
that you got this selector from. If the capabilties are nonnull, the selector type is given byTypeSignature.getType()
. String selectors, where type isColumnType.STRING
, may return any type of object from this method, especially in cases where the selector is casting objects to string at selection time. Callers are encouraged to avoid the need to deal with various objects by usingColumnSelectorFactory.makeDimensionSelector(org.apache.druid.query.dimension.DimensionSpec)
instead. Numeric selectors, whereTypeSignature.isNumeric()
, may return any type ofNumber
. Callers that wish to deal with more specific types should treat the originalColumnValueSelector
as aBaseLongColumnValueSelector
,BaseDoubleColumnValueSelector
, orBaseFloatColumnValueSelector
instead. Array selectors, whereTypeSignature.isArray()
, must returnObject[]
. The array may contain null elements, and the array itself may also be null. Selectors of unknown type, whereColumnSelectorFactory.getColumnCapabilities(String)
returns null, may return any type of object. Callers must be prepared for a wide variety of possible input objects. This case is common during ingestion, where selectors are built on top of external data.- Specified by:
getObject
in interfaceBaseObjectColumnValueSelector<Object>
-
-