Package org.apache.parquet.column
Enum Encoding
- java.lang.Object
-
- java.lang.Enum<Encoding>
-
- org.apache.parquet.column.Encoding
-
- All Implemented Interfaces:
Serializable
,Comparable<Encoding>
public enum Encoding extends Enum<Encoding>
encoding of the data
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BIT_PACKED
Deprecated.This is no longer used, and has been replaced byRLE
which is combination of bit packing and rleBYTE_STREAM_SPLIT
DELTA_BINARY_PACKED
Delta encoding for integers.DELTA_BYTE_ARRAY
Incremental-encoded byte array.DELTA_LENGTH_BYTE_ARRAY
Encoding for byte arrays to separate the length values and the data.PLAIN
PLAIN_DICTIONARY
Deprecated.now replaced by RLE_DICTIONARY for the data page encoding and PLAIN for the dictionary page encodingRLE
Actually a combination of bit packing and run length encoding.RLE_DICTIONARY
Dictionary encoding: the ids are encoded using the RLE encoding
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ValuesReader
getDictionaryBasedValuesReader(ColumnDescriptor descriptor, ValuesType valuesType, Dictionary dictionary)
To read decoded values that require a dictionaryValuesReader
getValuesReader(ColumnDescriptor descriptor, ValuesType valuesType)
To read decoded values that don't require a dictionaryDictionary
initDictionary(ColumnDescriptor descriptor, DictionaryPage dictionaryPage)
initializes a dictionary from a pageboolean
usesDictionary()
static Encoding
valueOf(String name)
Returns 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 Detail
-
PLAIN
public static final Encoding PLAIN
-
RLE
public static final Encoding RLE
Actually a combination of bit packing and run length encoding. TODO: Should we rename this to be more clear?
-
BYTE_STREAM_SPLIT
public static final Encoding BYTE_STREAM_SPLIT
-
BIT_PACKED
@Deprecated public static final Encoding BIT_PACKED
Deprecated.This is no longer used, and has been replaced byRLE
which is combination of bit packing and rle
-
PLAIN_DICTIONARY
@Deprecated public static final Encoding PLAIN_DICTIONARY
Deprecated.now replaced by RLE_DICTIONARY for the data page encoding and PLAIN for the dictionary page encoding
-
DELTA_BINARY_PACKED
public static final 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
public static final Encoding 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
public static final Encoding 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
public static final Encoding RLE_DICTIONARY
Dictionary encoding: the ids are encoded using the RLE encoding
-
-
Method Detail
-
values
public static Encoding[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Encoding c : Encoding.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Encoding valueOf(String name)
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
public ValuesReader getValuesReader(ColumnDescriptor descriptor, ValuesType valuesType)
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
-
-