public interface DimensionDictionarySelector
DimensionSelector,
SingleValueDimensionVectorSelector, and
MultiValueDimensionVectorSelector.| Modifier and Type | Field and Description |
|---|---|
static int |
CARDINALITY_UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
int |
getValueCardinality()
Value cardinality is the cardinality of the different occurring values.
|
IdLookup |
idLookup()
Returns
IdLookup if available for this DimensionSelector, or null. |
String |
lookupName(int id)
Returns the value for a particular dictionary id as a Java String.
|
default ByteBuffer |
lookupNameUtf8(int id)
Returns the value for a particular dictionary id as UTF-8 bytes.
|
boolean |
nameLookupPossibleInAdvance()
Returns true if it is possible to
lookupName(int) by ids from 0 to getValueCardinality()
before the rows with those ids are returned. |
default boolean |
supportsLookupNameUtf8()
Returns whether this selector supports
lookupNameUtf8(int). |
static final int CARDINALITY_UNKNOWN
int getValueCardinality()
CARDINALITY_UNKNOWN if unknown.@CalledFromHotLoop @Nullable String lookupName(int id)
java.lang.String, always use this method. It will be at least as fast
as calling lookupNameUtf8(int) and decoding the bytes. However, if you want UTF-8 bytes, then check if
supportsLookupNameUtf8() returns true, and if it does, use lookupNameUtf8(int) instead.id - id to lookup the dictionary value for@Nullable default ByteBuffer lookupNameUtf8(int id)
ReferenceCountingSegment.
Performance note: if you want UTF-8 bytes, and supportsLookupNameUtf8() returns true, always use this
method. It will be at least as fast as calling lookupName(int) and encoding the bytes. However, if you want a
java.lang.String, then use lookupName(int) instead of this method.id - id to lookup the dictionary value forUnsupportedOperationException - if supportsLookupNameUtf8() is falsedefault boolean supportsLookupNameUtf8()
lookupNameUtf8(int).boolean nameLookupPossibleInAdvance()
lookupName(int) by ids from 0 to getValueCardinality()
before the rows with those ids are returned.
Returns false if lookupName(int) could be called with ids, returned from the most recent row (or row
vector) returned by this DimensionSelector, but not earlier. If getValueCardinality() of this
selector additionally returns CARDINALITY_UNKNOWN, lookupName() couldn't be called with
ids, returned by not the most recent row (or row vector), i. e. names for ids couldn't be looked up "later". If
getValueCardinality() returns a non-negative number, lookupName() could be called with any ids,
returned from rows (or row vectors) returned since the creation of this DimensionSelector.
If lookupName(int) is called with an ineligible id, result is undefined: exception could be thrown, or
null returned, or some other random value.
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.