RussellSpitzer commented on code in PR #10943: URL: https://github.com/apache/iceberg/pull/10943#discussion_r1719058057
########## arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedColumnIterator.java: ########## @@ -69,12 +69,14 @@ public boolean producesDictionaryEncodedVector() { } public abstract class BatchReader { - public void nextBatch(FieldVector fieldVector, int typeWidth, NullabilityHolder holder) { + public void nextBatch( + int numValsToRead, FieldVector fieldVector, int typeWidth, NullabilityHolder holder) { int rowsReadSoFar = 0; - while (rowsReadSoFar < batchSize && hasNext()) { + while (rowsReadSoFar < batchSize && hasNext() && rowsReadSoFar < numValsToRead) { advance(); + int expectedBatchSize = Math.min(batchSize - rowsReadSoFar, numValsToRead - rowsReadSoFar); Review Comment: We definitely need to guard num_vals to read here to be greater than -1, we still have the potential for overflow but probably not huge if we require -1 as the only negative value allowed -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org