LuciferYang commented on code in PR #37293:
URL: https://github.com/apache/spark/pull/37293#discussion_r938071813


##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedDeltaBinaryPackedReader.java:
##########
@@ -300,7 +300,8 @@ private void unpackMiniBlock() throws IOException {
         bitWidths[currentMiniBlock]);
     for (int j = 0; j < miniBlockSizeInValues; j += 8) {
       ByteBuffer buffer = in.slice(packer.getBitWidth());
-      packer.unpack8Values(buffer, buffer.position(), unpackedValuesBuffer, j);
+      packer.unpack8Values(buffer.array(),

Review Comment:
   @sunchao Double check the code path,  `in` is an `ByteBufferInputStream` and 
passed in by `initFromPage`  method.
   
   The `ByteBufferInputStream` here should come from
   
   
https://github.com/apache/spark/blob/bf8a4c47ac3752edf86f1e14e4050e8d202b34a4/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java#L389
   
   `page.getData().toInputStream()` always return a `SingleBufferInputStream` 
wrapped `HeapByteBuffer`, `SingleBufferInputStream. slice` should still return 
a `HeapByteBuffer`, so  in the current code path, `buffer.hasArray` should 
always return true. If I'm wrong, please correct me.
   
   
   



-- 
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]

Reply via email to