public class StringDimensionIndexer extends DictionaryEncodedColumnIndexer<int[],String>
dimLookup, isSparse, sortedLookup| Constructor and Description |
|---|
StringDimensionIndexer(DimensionSchema.MultiValueHandling multiValueHandling,
boolean hasBitmapIndexes,
boolean hasSpatialIndexes,
boolean useMaxMemoryEstimates) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkUnsortedEncodedKeyComponentsEqual(int[] lhs,
int[] rhs)
Check if two row value arrays from Row keys are equal.
|
int |
compareUnsortedEncodedKeyComponents(int[] lhs,
int[] rhs)
Compares the row values for this DimensionIndexer's dimension from a Row key.
|
Object |
convertUnsortedEncodedKeyComponentToActualList(int[] key)
Given a row value array from a Row key, as described in the documentation for
DimensionIndexer.compareUnsortedEncodedKeyComponents(EncodedKeyComponentType, EncodedKeyComponentType), convert the unsorted encoded values to a list of actual values. |
long |
estimateEncodedKeyComponentSize(int[] keys)
Estimates size of the given key component.
|
void |
fillBitmapsFromUnsortedEncodedKeyComponent(int[] key,
int rowNum,
MutableBitmap[] bitmapIndexes,
BitmapFactory factory)
Helper function for building bitmap indexes for integer-encoded dimensions.
|
ColumnCapabilities |
getColumnCapabilities() |
int |
getUnsortedEncodedKeyComponentHashCode(int[] key)
Given a row value array from a Row key, generate a hashcode.
|
DimensionSelector |
makeDimensionSelector(DimensionSpec spec,
IncrementalIndexRowHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column as Strings.
|
EncodedKeyComponent<int[]> |
processRowValsToUnsortedEncodedKeyComponent(Object dimValues,
boolean reportParseExceptions)
Encodes the given row value(s) of the dimension to be used within a row key.
|
convertUnsortedValuesToSorted, dictionaryEncodesAllValues, getActualValue, getCardinality, getEncodedValue, getMaxValue, getMinValue, getSortedEncodedValueFromUnsorted, getSortedIndexedValues, getUnsortedEncodedValueFromSorted, makeColumnValueSelector, setSparseIndexed, sortedLookupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormatpublic StringDimensionIndexer(DimensionSchema.MultiValueHandling multiValueHandling, boolean hasBitmapIndexes, boolean hasSpatialIndexes, boolean useMaxMemoryEstimates)
public EncodedKeyComponent<int[]> processRowValsToUnsortedEncodedKeyComponent(@Nullable Object dimValues, boolean reportParseExceptions)
DimensionIndexerFor example, the dictionary-encoded String-type column will return an int[] containing dictionary IDs.
dimValues - Value(s) of the dimension in a row. This can
either be a single value or a list of values
(for multi-valued dimensions)reportParseExceptions - true if parse exceptions should be reported,
false otherwiseEncodedKeyComponentType and the effective
size of the key component in bytes.public long estimateEncodedKeyComponentSize(int[] keys)
Deprecated method. Use processRowValsToUnsortedEncodedKeyComponent(Object, boolean)
and EncodedKeyComponent.getEffectiveSizeBytes().
public int compareUnsortedEncodedKeyComponents(int[] lhs,
int[] rhs)
DimensionIndexerDimensionHandler.getEncodedValueSelectorComparator(), otherwise incorrect ordering/merging of rows
can occur during ingestion, causing issues such as imperfect rollup.lhs - dimension value array from a Row keyrhs - dimension value array from a Row keypublic boolean checkUnsortedEncodedKeyComponentsEqual(int[] lhs,
int[] rhs)
DimensionIndexerlhs - dimension value array from a Row keyrhs - dimension value array from a Row keypublic int getUnsortedEncodedKeyComponentHashCode(int[] key)
DimensionIndexerkey - dimension value array from a Row keypublic ColumnCapabilities getColumnCapabilities()
public DimensionSelector makeDimensionSelector(DimensionSpec spec, IncrementalIndexRowHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexerspec - Specifies the output name of a dimension and any extraction functions to be applied.currEntry - Provides access to the current Row object in the Cursordesc - Descriptor object for this dimension within an IncrementalIndex@Nullable public Object convertUnsortedEncodedKeyComponentToActualList(int[] key)
DimensionIndexerDimensionIndexer.compareUnsortedEncodedKeyComponents(EncodedKeyComponentType, EncodedKeyComponentType), convert the unsorted encoded values to a list of actual values.
If the key has one element, this method should return a single Object instead of a list.key - dimension value array from a Row keypublic void fillBitmapsFromUnsortedEncodedKeyComponent(int[] key,
int rowNum,
MutableBitmap[] bitmapIndexes,
BitmapFactory factory)
DimensionIndexerkey - dimension value array from a Row keyrowNum - current row numberbitmapIndexes - array of bitmaps, indexed by integer dimension valuefactory - bitmap factoryCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.