File tree Expand file tree Collapse file tree
parquet-column/src/main/java/org/apache/parquet/column/values/plain Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727import org .slf4j .Logger ;
2828import org .slf4j .LoggerFactory ;
2929
30+ /**
31+ * ValuesReader for variable-length {@code BYTE_ARRAY} columns.
32+ *
33+ * <p>When the column carries the logical type {@code DECIMAL}, the bytes read
34+ * here are the big-endian two's-complement form of the un-scaled integer.
35+ * It slices the requested number of bytes without flipping and
36+ * returns them as a {@link org.apache.parquet.io.api.Binary}.
37+ */
3038public class BinaryPlainValuesReader extends ValuesReader {
3139 private static final Logger LOG = LoggerFactory .getLogger (BinaryPlainValuesReader .class );
3240 private ByteBufferInputStream in ;
Original file line number Diff line number Diff line change 3232import org .slf4j .LoggerFactory ;
3333
3434/**
35- * Plain encoding except for booleans
35+ * Plain encoding except for booleans.
36+ *
37+ * <p>Endianness note for DECIMAL: when a DECIMAL value is stored in a
38+ * BYTE_ARRAY column, the {@link org.apache.parquet.io.api.Binary}
39+ * passed to this writer already contains the big-endian two's-complement bytes
40+ * of the un-scaled integer (the same bytes produced by
41+ * {@link java.math.BigInteger#toByteArray()}). This writer keeps those bytes
42+ * exactly as they are and only adds the 4-byte little-endian length prefix
43+ * required by the PLAIN encoding. Bytes are not re-ordered..</p>
3644 */
3745public class PlainValuesWriter extends ValuesWriter {
3846 private static final Logger LOG = LoggerFactory .getLogger (PlainValuesWriter .class );
You can’t perform that action at this time.
0 commit comments