Class ListSubfieldEncoder
java.lang.Object
org.apache.arrow.vector.dictionary.ListSubfieldEncoder
Sub fields encoder/decoder for Dictionary encoded
BaseListVector
.-
Constructor Summary
ConstructorsConstructorDescriptionListSubfieldEncoder
(Dictionary dictionary, BufferAllocator allocator) ListSubfieldEncoder
(Dictionary dictionary, BufferAllocator allocator, ArrowBufHasher hasher) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptiondecodeListSubField
(BaseListVector vector) Decodes a dictionary subfields encoded vector using the provided dictionary.static BaseListVector
decodeListSubField
(BaseListVector vector, Dictionary dictionary, BufferAllocator allocator) Decodes a dictionary subfields encoded vector using the provided dictionary.encodeListSubField
(BaseListVector vector) Dictionary encodes subfields for complex vector with a provided dictionary.
-
Constructor Details
-
ListSubfieldEncoder
-
ListSubfieldEncoder
Construct an instance.
-
-
Method Details
-
encodeListSubField
Dictionary encodes subfields for complex vector with a provided dictionary. The dictionary must contain all values in the sub fields vector.- Parameters:
vector
- vector to encode- Returns:
- dictionary encoded vector
-
decodeListSubField
Decodes a dictionary subfields encoded vector using the provided dictionary.decodeListSubField(BaseListVector, Dictionary, BufferAllocator)
should be used instead if only decoding is required as it can avoid building theDictionaryHashTable
which only makes sense when encoding.- Parameters:
vector
- dictionary encoded vector, its data vector must be int type- Returns:
- vector with values restored from dictionary
-
decodeListSubField
public static BaseListVector decodeListSubField(BaseListVector vector, Dictionary dictionary, BufferAllocator allocator) Decodes a dictionary subfields encoded vector using the provided dictionary.- Parameters:
vector
- dictionary encoded vector, its data vector must be int typedictionary
- dictionary used to decode the valuesallocator
- allocator the decoded values use- Returns:
- vector with values restored from dictionary
-