wgtmac commented on code in PR #1291:
URL: https://github.com/apache/parquet-mr/pull/1291#discussion_r1531530234
##########
parquet-column/src/main/java/org/apache/parquet/column/values/bytestreamsplit/ByteStreamSplitValuesReader.java:
##########
@@ -76,18 +87,12 @@ public void initFromPage(int valuesCount,
ByteBufferInputStream stream)
throw new ParquetDecodingException(errorMessage);
}
- // Allocate buffer for all of the byte stream data.
+ // Eagerly read and decode the data. This allows returning stable
+ // Binary views into the internal decode buffer for FIXED_LEN_BYTE_ARRAY.
final int totalSizeInBytes = stream.available();
- byteStreamData = new byte[totalSizeInBytes];
-
- // Eagerly read the data for each stream.
- final int numRead = stream.read(byteStreamData, 0, totalSizeInBytes);
- if (numRead != totalSizeInBytes) {
- String errorMessage = String.format(
- "Failed to read requested number of bytes. Expected: %d. Read %d.",
totalSizeInBytes, numRead);
- throw new ParquetDecodingException(errorMessage);
Review Comment:
Yes, you're right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]