Enum Encoding

    • 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 by RLE 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 name
        NullPointerException - 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 column
        dictionaryPage - a dictionary page
        Returns:
        the corresponding dictionary
        Throws:
        IOException - if there is an exception while reading the dictionary page
        UnsupportedOperationException - 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 read
        valuesType - 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 read
        valuesType - the type of values
        dictionary - the dictionary
        Returns:
        the proper values reader for the given column
        Throws:
        UnsupportedOperationException - if the encoding is not dictionary based