pvary commented on code in PR #16871:
URL: https://github.com/apache/iceberg/pull/16871#discussion_r3812874933
##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowBatchReader.java:
##########
@@ -43,16 +50,41 @@ public final ColumnarBatch read(ColumnarBatch reuse, int
numRowsToRead) {
ColumnVector[] columnVectors = new ColumnVector[readers.length];
for (int i = 0; i < readers.length; i += 1) {
- vectorHolders[i] = readers[i].read(vectorHolders[i], numRowsToRead);
- int numRowsInVector = vectorHolders[i].numValues();
+ VectorHolder holder = readers[i].read(vectorHolders[i], numRowsToRead);
+ if (holder.isDummy()) {
+ // The column is not in the data file, so the reader returns the value
it should be read as
+ // instead of a vector. Build a vector holding that value because
callers read a batch as an
+ // Arrow VectorSchemaRoot, which has no way to represent a column
without a vector.
+ closeVector(vectorHolders[i]);
Review Comment:
What about `reuse`?
--
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]