thswlsqls commented on code in PR #17055:
URL: https://github.com/apache/iceberg/pull/17055#discussion_r3562742839
##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedDictionaryEncodedParquetValuesReader.java:
##########
@@ -143,11 +143,7 @@ protected void nextVal(
FieldVector vector, Dictionary dict, int idx, int currentVal, int
typeWidth) {
ByteBuffer buffer = dict.decodeToBinary(currentVal).toByteBuffer();
((BaseVariableWidthVector) vector)
- .setSafe(
- idx,
- buffer.array(),
- buffer.position() + buffer.arrayOffset(),
- buffer.limit() - buffer.position());
+ .setSafe(idx, buffer, buffer.position(), buffer.remaining());
Review Comment:
No meaningful difference — it's still a single copy of the same bytes. The
`ByteBuffer` overload of `setSafe` copies `remaining()` bytes the same way; the
old `buffer.array()` path just couldn't handle direct (non-array-backed)
buffers, which is the bug this fixes.
--
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]