You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/06/20 22:15:05 UTC

[GitHub] [iceberg] huaxingao commented on a diff in pull request #5079: Make VectorizedParquetDefinitionLevelReader work with off heap byte buffer

huaxingao commented on code in PR #5079:
URL: https://github.com/apache/iceberg/pull/5079#discussion_r901987433


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedParquetDefinitionLevelReader.java:
##########
@@ -415,8 +415,13 @@ protected void nextVal(
       int startOffset = ((BaseVariableWidthVector) vector).getStartOffset(idx);
       // It is possible that the data buffer was reallocated. So it is important to
       // not cache the data buffer reference but instead use vector.getDataBuffer().
-      vector.getDataBuffer().setBytes(startOffset, buffer.array(), buffer.position() + buffer.arrayOffset(),
-          buffer.limit() - buffer.position());
+      if (buffer.isDirect()) {
+        vector.getDataBuffer().setBytes(startOffset, buffer, buffer.position(),
+            buffer.limit() - buffer.position());

Review Comment:
   Thanks for taking a look! I changed the fix to one-line.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org