Package org.apache.parquet.column
Enum Encoding
- All Implemented Interfaces:
Serializable,Comparable<Encoding>
encoding of the data
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.Delta encoding for integers.Incremental-encoded byte array.Encoding for byte arrays to separate the length values and the data.Deprecated.now replaced by RLE_DICTIONARY for the data page encoding and PLAIN for the dictionary page encodingActually a combination of bit packing and run length encoding.Dictionary encoding: the ids are encoded using the RLE encoding -
Method Summary
Modifier and TypeMethodDescriptiongetDictionaryBasedValuesReader(ColumnDescriptor descriptor, ValuesType valuesType, Dictionary dictionary) To read decoded values that require a dictionarygetValuesReader(ColumnDescriptor descriptor, ValuesType valuesType) To read decoded values that don't require a dictionaryinitDictionary(ColumnDescriptor descriptor, DictionaryPage dictionaryPage) initializes a dictionary from a pagebooleanstatic EncodingReturns the enum constant of this type with the specified name.static Encoding[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PLAIN
-
RLE
Actually a combination of bit packing and run length encoding. TODO: Should we rename this to be more clear? -
BYTE_STREAM_SPLIT
-
BIT_PACKED
Deprecated.This is no longer used, and has been replaced byRLEwhich is combination of bit packing and rle -
PLAIN_DICTIONARY
Deprecated.now replaced by RLE_DICTIONARY for the data page encoding and PLAIN for the dictionary page encoding -
DELTA_BINARY_PACKED
Delta encoding for integers. This can be used for int columns and works best on sorted data -
DELTA_LENGTH_BYTE_ARRAY
Encoding for byte arrays to separate the length values and the data. The lengths are encoded using DELTA_BINARY_PACKED -
DELTA_BYTE_ARRAY
Incremental-encoded byte array. Prefix lengths are encoded using DELTA_BINARY_PACKED. Suffixes are stored as delta length byte arrays. -
RLE_DICTIONARY
Dictionary encoding: the ids are encoded using the RLE encoding
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
usesDictionary
public boolean usesDictionary()- Returns:
- whether this encoding requires a dictionary
-
initDictionary
public Dictionary initDictionary(ColumnDescriptor descriptor, DictionaryPage dictionaryPage) throws IOException initializes a dictionary from a page- Parameters:
descriptor- the column descriptor for the dictionary-encoded columndictionaryPage- a dictionary page- Returns:
- the corresponding dictionary
- Throws:
IOException- if there is an exception while reading the dictionary pageUnsupportedOperationException- if the encoding is not dictionary based
-
getValuesReader
To read decoded values that don't require a dictionary- Parameters:
descriptor- the column to readvaluesType- the type of values- Returns:
- the proper values reader for the given column
- Throws:
UnsupportedOperationException- if the encoding is dictionary based
-
getDictionaryBasedValuesReader
public ValuesReader getDictionaryBasedValuesReader(ColumnDescriptor descriptor, ValuesType valuesType, Dictionary dictionary) To read decoded values that require a dictionary- Parameters:
descriptor- the column to readvaluesType- the type of valuesdictionary- the dictionary- Returns:
- the proper values reader for the given column
- Throws:
UnsupportedOperationException- if the encoding is not dictionary based
-
RLEwhich is combination of bit packing and rle