RussellSpitzer commented on code in PR #10943: URL: https://github.com/apache/iceberg/pull/10943#discussion_r1720011663
########## parquet/src/main/java/org/apache/iceberg/parquet/VectorizedParquetReader.java: ########## @@ -141,8 +148,15 @@ public T next() { advance(); } + long remainingValues = nextRowGroupStart - valuesRead; + int remainingLimit = (int) (pushedLimit - valuesRead); // batchSize is an integer, so casting to integer is safe - int numValuesToRead = (int) Math.min(nextRowGroupStart - valuesRead, batchSize); + int numValuesToRead = + (int) + Math.min( + remainingValues, + (remainingLimit > 0 ? Math.min(batchSize, remainingLimit) : batchSize)); Review Comment: This is just a suggestion, I'm wondering how you feel about it as well -- 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