E
- encoded vector type.D
- decoded vector type, which is also the dictionary type.public class HashTableDictionaryEncoder<E extends BaseIntVector,D extends ElementAddressableVector> extends Object implements DictionaryEncoder<E,D>
Constructor and Description |
---|
HashTableDictionaryEncoder(D dictionary)
Constructs a dictionary encoder.
|
HashTableDictionaryEncoder(D dictionary,
boolean encodeNull)
Constructs a dictionary encoder.
|
HashTableDictionaryEncoder(D dictionary,
boolean encodeNull,
ArrowBufHasher hasher)
Constructs a dictionary encoder.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(D input,
E output)
Encodes an input vector by a hash table.
|
public HashTableDictionaryEncoder(D dictionary)
dictionary
- the dictionary.public HashTableDictionaryEncoder(D dictionary, boolean encodeNull)
dictionary
- the dictionary.encodeNull
- a flag indicating if null should be encoded.
It determines the behaviors for processing null values in the input during encoding/decoding.
public HashTableDictionaryEncoder(D dictionary, boolean encodeNull, ArrowBufHasher hasher)
dictionary
- the dictionary.encodeNull
- a flag indicating if null should be encoded.
It determines the behaviors for processing null values in the input during encoding.
When a null is encountered in the input,
1) If the flag is set to true, the encoder searches for the value in the dictionary,
and outputs the index in the dictionary.
2) If the flag is set to false, the encoder simply produces a null in the output.hasher
- the hasher used to calculate the hash code.public void encode(D input, E output)
encode
in interface DictionaryEncoder<E extends BaseIntVector,D extends ElementAddressableVector>
input
- the input vector.output
- the output vector.Copyright © 2023 The Apache Software Foundation. All rights reserved.