This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 5b797ef63f [core] Fix DataEvolutionBatchScan shard chaining (#8500)
5b797ef63f is described below
commit 5b797ef63fba5e98bf4fd285fb5a34877c91ee81
Author: QuakeWang <[email protected]>
AuthorDate: Tue Jul 7 23:23:05 2026 +0800
[core] Fix DataEvolutionBatchScan shard chaining (#8500)
---
.../apache/paimon/globalindex/DataEvolutionBatchScan.java | 3 ++-
.../paimon/globalindex/DataEvolutionBatchScanTest.java | 13 +++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionBatchScan.java
b/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionBatchScan.java
index 39634f012c..ca83c6b497 100644
---
a/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionBatchScan.java
+++
b/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionBatchScan.java
@@ -78,7 +78,8 @@ public class DataEvolutionBatchScan implements DataTableScan {
@Override
public DataTableScan withShard(int indexOfThisSubtask, int
numberOfParallelSubtasks) {
- return batchScan.withShard(indexOfThisSubtask,
numberOfParallelSubtasks);
+ batchScan.withShard(indexOfThisSubtask, numberOfParallelSubtasks);
+ return this;
}
@Override
diff --git
a/paimon-core/src/test/java/org/apache/paimon/globalindex/DataEvolutionBatchScanTest.java
b/paimon-core/src/test/java/org/apache/paimon/globalindex/DataEvolutionBatchScanTest.java
index 4c7cc83d07..b406b9793f 100644
---
a/paimon-core/src/test/java/org/apache/paimon/globalindex/DataEvolutionBatchScanTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/globalindex/DataEvolutionBatchScanTest.java
@@ -24,6 +24,7 @@ import org.apache.paimon.predicate.Predicate;
import org.apache.paimon.predicate.PredicateBuilder;
import org.apache.paimon.table.source.DataSplit;
import org.apache.paimon.table.source.DataTableBatchScan;
+import org.apache.paimon.table.source.DataTableScan;
import org.apache.paimon.table.source.Split;
import org.apache.paimon.table.source.snapshot.SnapshotReader;
import org.apache.paimon.types.DataField;
@@ -99,6 +100,18 @@ public class DataEvolutionBatchScanTest {
assertThat(captor.getValue()).isSameAs(nonRowIdPredicate);
}
+ @Test
+ public void testWithShardKeepsDataEvolutionWrapper() {
+ DataTableBatchScan batchScan = mock(DataTableBatchScan.class);
+ when(batchScan.withShard(0, 2)).thenReturn(batchScan);
+
+ DataEvolutionBatchScan scan = new DataEvolutionBatchScan(null,
batchScan);
+ DataTableScan returned = scan.withShard(0, 2);
+
+ assertThat(returned).isSameAs(scan);
+ verify(batchScan).withShard(0, 2);
+ }
+
@Test
public void testWrapToIndexSplitsRandomly() {
Random random = new Random();