Class DeltaByteArrayReader
- java.lang.Object
-
- org.apache.parquet.column.values.ValuesReader
-
- org.apache.parquet.column.values.deltastrings.DeltaByteArrayReader
-
- All Implemented Interfaces:
RequiresPreviousReader
public class DeltaByteArrayReader extends ValuesReader implements RequiresPreviousReader
Reads binary data written byDeltaByteArrayWriter
-
-
Constructor Summary
Constructors Constructor Description DeltaByteArrayReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitFromPage(int valueCount, org.apache.parquet.bytes.ByteBufferInputStream stream)Called to initialize the column reader from a part of a page.BinaryreadBytes()voidsetPreviousReader(ValuesReader reader)There was a bug (PARQUET-246) in which DeltaByteArrayWriter's reset() method did not clear the previous value state that it tracks internally.voidskip()Skips the next value in the page-
Methods inherited from class org.apache.parquet.column.values.ValuesReader
getNextOffset, initFromPage, initFromPage, readBoolean, readDouble, readFloat, readInteger, readLong, readValueDictionaryId, skip, updateNextOffset
-
-
-
-
Method Detail
-
initFromPage
public void initFromPage(int valueCount, org.apache.parquet.bytes.ByteBufferInputStream stream) throws IOExceptionDescription copied from class:ValuesReaderCalled 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
- Overrides:
initFromPagein classValuesReader- Parameters:
valueCount- count of values in this pagestream- an input stream containing the page data at the correct offset- Throws:
IOException- if there is an exception while reading from the input stream
-
skip
public void skip()
Description copied from class:ValuesReaderSkips the next value in the page- Specified by:
skipin classValuesReader
-
readBytes
public Binary readBytes()
- Overrides:
readBytesin classValuesReader- Returns:
- the next Binary from the page
-
setPreviousReader
public void setPreviousReader(ValuesReader reader)
There was a bug (PARQUET-246) in which DeltaByteArrayWriter's reset() method did not clear the previous value state that it tracks internally. This resulted in the first value of all pages (except for the first page) to be a delta from the last value of the previous page. In order to read corrupted files written with this bug, when reading a new page we need to recover the previous page's last value to use it (if needed) to read the first value.- Specified by:
setPreviousReaderin interfaceRequiresPreviousReader
-
-