rdblue commented on a change in pull request #188: Split parquet file scan 
tasks at row group boundaries
URL: https://github.com/apache/incubator-iceberg/pull/188#discussion_r285220146
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
 ##########
 @@ -86,16 +89,38 @@ public String toString() {
         .toString();
   }
 
-  /**
-   * Visible for Testing
-   */
-  static final class SplitScanTaskIterator implements Iterator<FileScanTask> {
+  @VisibleForTesting
+  static final class OffsetsBasedSplitScanTaskIterator implements 
Iterator<FileScanTask> {
+    private final List<Long> splitOffsets;
+    private final FileScanTask parentScanTask;
+    private int idx = 0;
+
+    OffsetsBasedSplitScanTaskIterator(List<Long> splitOffsets, FileScanTask 
fileScanTask) {
+      this.splitOffsets = splitOffsets;
+      this.parentScanTask = fileScanTask;
+    }
+
+    @Override
+    public boolean hasNext() {
+      return idx < splitOffsets.size();
+    }
+
+    @Override
+    public FileScanTask next() {
+      long start = splitOffsets.get(idx++);
 
 Review comment:
   Nit: I don't think it is a good practice to use the return value of the `++` 
operator. It is difficult to remember whether the returned value is the 
original or incremented one. I think it is more clear to put this on a separate 
line.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to