rdblue commented on code in PR #5079:
URL: https://github.com/apache/iceberg/pull/5079#discussion_r901942514
##########
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:
If the buffer can be passed directly, why not do this in both direct and
on-heap cases?
--
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]