sadikovi commented on code in PR #37485:
URL: https://github.com/apache/spark/pull/37485#discussion_r944115806
##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedDeltaBinaryPackedReader.java:
##########
@@ -300,8 +300,12 @@ private void unpackMiniBlock() throws IOException {
bitWidths[currentMiniBlock]);
for (int j = 0; j < miniBlockSizeInValues; j += 8) {
ByteBuffer buffer = in.slice(packer.getBitWidth());
- packer.unpack8Values(buffer.array(),
- buffer.arrayOffset() + buffer.position(), unpackedValuesBuffer, j);
+ if (buffer.hasArray()) {
+ packer.unpack8Values(buffer.array(),
+ buffer.arrayOffset() + buffer.position(), unpackedValuesBuffer, j);
+ } else {
+ packer.unpack8Values(buffer, buffer.position(), unpackedValuesBuffer,
j);
Review Comment:
Yes, there are no unit tests for this. Even before this patch, this would
only be covered if the encoding is enabled and data pages v2 are used and the
original PR did not have unit tests for array usage.
--
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]