wangyum commented on code in PR #18002:
URL: https://github.com/apache/iceberg/pull/18002#discussion_r3965244262
##########
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:
No, can we can not change it, because it is a behavior change. Please see
this test:
```java
@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, null);
List<FileScanTask> splits = ImmutableList.copyOf(task.split(128L));
assertThat(splits).hasSize(1);
assertThat(splits.get(0)).isSameAs(task);
// behavior must be identical to the wrapper it replaces: whole file
from offset 0
assertThat(splits.get(0).start()).isEqualTo(0L);
assertThat(splits.get(0).length()).isEqualTo(64L);
assertThat(splits.get(0).estimatedRowsCount()).isEqualTo(1L);
}
```
--
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]