huaxingao commented on code in PR #10943:
URL: https://github.com/apache/iceberg/pull/10943#discussion_r1778973376


##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -1151,6 +1152,11 @@ public ReadBuilder withAADPrefix(ByteBuffer aadPrefix) {
       return this;
     }
 
+    public ReadBuilder pushedlimit(int limit) {

Review Comment:
   Changed to `Preconditions.checkArgument`. Thanks



##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedColumnIterator.java:
##########
@@ -69,12 +69,20 @@ 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;
+        if (numValsToRead < 0) {
+          throw new IllegalStateException("numValsToRead has invalid value");

Review Comment:
   Changed. Thanks



##########
parquet/src/main/java/org/apache/iceberg/parquet/VectorizedParquetReader.java:
##########
@@ -49,6 +49,7 @@ public class VectorizedParquetReader<T> extends 
CloseableGroup implements Closea
   private final boolean caseSensitive;
   private final int batchSize;
   private final NameMapping nameMapping;
+  private int pushedLimit = -1;
 
   public VectorizedParquetReader(

Review Comment:
   I have changed `int pushedLimit` to `Integer pushedLimit` in all the classes 
that use `pushedLimit`. I didn't add another constructor in 
`VectorizedParquetReader` because there is only one place the 
`VectorizedParquetReader` constructor gets called, but I have added additional 
constructors in other classes such as `BaseRowReader`, so we will rewrite less 
use 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: 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

Reply via email to