Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* ValuesReader for variable-length {@code BYTE_ARRAY} columns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the good place to add the comment since this class is for a specific encoding of binary physical type.

As I have replied in the issue, the spec is clear on this so we don't even need the explaination.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, yes on retrospect code comment may not be the best, I'll check if the readme can be made more clear since the user pointed to the readme asking for clarity. Will iterate and get back thanks!

*
* <p>When the column carries the logical type {@code DECIMAL}, the bytes read
* here are the big-endian two's-complement form of the un-scaled integer.
* It slices the requested number of bytes without flipping and
* returns them as a {@link org.apache.parquet.io.api.Binary}.
*/
public class BinaryPlainValuesReader extends ValuesReader {
private static final Logger LOG = LoggerFactory.getLogger(BinaryPlainValuesReader.class);
private ByteBufferInputStream in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@
import org.slf4j.LoggerFactory;

/**
* Plain encoding except for booleans
* Plain encoding except for booleans.
*
* <p>Endianness note for DECIMAL: when a DECIMAL value is stored in a
* BYTE_ARRAY column, the {@link org.apache.parquet.io.api.Binary}
* passed to this writer already contains the big-endian two's-complement bytes
* of the un-scaled integer (the same bytes produced by
* {@link java.math.BigInteger#toByteArray()}). This writer keeps those bytes
* exactly as they are and only adds the 4-byte little-endian length prefix
* required by the PLAIN encoding. Bytes are not re-ordered.</p>
*/
public class PlainValuesWriter extends ValuesWriter {
private static final Logger LOG = LoggerFactory.getLogger(PlainValuesWriter.class);
Expand Down