wangyum commented on code in PR #18002:
URL: https://github.com/apache/iceberg/pull/18002#discussion_r3957368335


##########
core/src/main/java/org/apache/iceberg/BaseContentScanTask.java:
##########
@@ -104,6 +104,8 @@ public Iterable<ThisT> split(long targetSplitSize) {
         return () ->
             new OffsetsAwareSplitScanTaskIterator<>(
                 self(), length(), splitOffsets, this::newSplitTask);
+      } else if (length() <= targetSplitSize) {
+        return ImmutableList.of(self());

Review Comment:
   LGTM



##########
core/src/test/java/org/apache/iceberg/util/TestTableScanUtil.java:
##########
@@ -332,6 +332,42 @@ public void testAdaptiveSplitSize() {
         .hasMessageStartingWith("Parallelism must be > 0: 0");
   }
 
+  @Test
+  public void testSplitSkipsWrapWhenFileFitsSingleSplit() {
+    // A small splittable file (no offsets) smaller than the target split size 
must not be wrapped
+    // in a redundant 1:1 SplitScanTask; split() should return the task itself.
+    BaseFileScanTask task = newScanTask(FileFormat.PARQUET, 64L);

Review Comment:
   ok



-- 
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]

Reply via email to