Class ValuesReader

    • Constructor Detail

      • ValuesReader

        public ValuesReader()
    • Method Detail

      • initFromPage

        @Deprecated
        public void initFromPage​(int valueCount,
                                 ByteBuffer page,
                                 int offset)
                          throws IOException
        Deprecated.
        Will be removed in 2.0.0
        Called to initialize the column reader from a part of a page. The underlying implementation knows how much data to read, so a length is not provided. Each page may contain several sections:
        • repetition levels column
        • definition levels column
        • data column
        This function is called with 'offset' pointing to the beginning of one of these sections, and should return the offset to the section following it.
        Parameters:
        valueCount - count of values in this page
        page - the array to read from containing the page data (repetition levels, definition levels, data)
        offset - where to start reading from in the page
        Throws:
        IOException
      • initFromPage

        @Deprecated
        public void initFromPage​(int valueCount,
                                 byte[] page,
                                 int offset)
                          throws IOException
        Deprecated.
        Same functionality as method of the same name that takes a ByteBuffer instead of a byte[]. This method is only provided for backward compatibility and will be removed in a future release. Please update any code using it as soon as possible.
        Throws:
        IOException
        See Also:
        initFromPage(int, ByteBuffer, int)
      • initFromPage

        public void initFromPage​(int valueCount,
                                 org.apache.parquet.bytes.ByteBufferInputStream in)
                          throws IOException
        Called to initialize the column reader from a part of a page. Implementations must consume all bytes from the input stream, leaving the stream ready to read the next section of data. The underlying implementation knows how much data to read, so a length is not provided. Each page may contain several sections:
        • repetition levels column
        • definition levels column
        • data column
        Parameters:
        valueCount - count of values in this page
        in - an input stream containing the page data at the correct offset
        Throws:
        IOException - if there is an exception while reading from the input stream
      • getNextOffset

        @Deprecated
        public int getNextOffset()
        Deprecated.
        Will be removed in 2.0.0
        Called to return offset of the next section
        Returns:
        offset of the next section
      • updateNextOffset

        protected void updateNextOffset​(int bytesRead)
      • readValueDictionaryId

        public int readValueDictionaryId()
        usable when the encoding is dictionary based
        Returns:
        the id of the next value from the page
      • readBoolean

        public boolean readBoolean()
        Returns:
        the next boolean from the page
      • readBytes

        public Binary readBytes()
        Returns:
        the next Binary from the page
      • readFloat

        public float readFloat()
        Returns:
        the next float from the page
      • readDouble

        public double readDouble()
        Returns:
        the next double from the page
      • readInteger

        public int readInteger()
        Returns:
        the next integer from the page
      • readLong

        public long readLong()
        Returns:
        the next long from the page
      • skip

        public abstract void skip()
        Skips the next value in the page
      • skip

        public void skip​(int n)
        Skips the next n values in the page
        Parameters:
        n - the number of values to be skipped