JustinBinber commented on code in PR #11285:
URL: https://github.com/apache/paimon/pull/11285#discussion_r4658533689


##########
paimon-core/src/main/java/org/apache/paimon/table/source/snapshot/SnapshotReaderImpl.java:
##########
@@ -657,6 +668,79 @@ public Plan readIncrementalDiff(Snapshot before) {
                 afterFiles);
     }
 
+    private FileStoreScan.Plan planForIncrementalDiff() {
+        return options.dataEvolutionEnabled()
+                ? ((DataEvolutionFileStoreScan) scan).planForIncrementalDiff()
+                : scan.plan();
+    }
+
+    private Plan toDataEvolutionIncrementalPlan(
+            Map<BinaryRow, Map<Integer, List<ManifestEntry>>> beforeFiles,
+            FileStoreScan.Plan afterPlan,
+            Map<BinaryRow, Map<Integer, List<ManifestEntry>>> afterFiles) {
+        Map<BinaryRow, Map<Integer, List<ManifestEntry>>> selected = new 
HashMap<>();
+        Map<Pair<BinaryRow, Integer>, RowRangeIndex> changedRanges = new 
HashMap<>();
+        RangeHelper<ManifestEntry> ranges =
+                new RangeHelper<>(entry -> entry.file().nonNullRowIdRange());
+        for (Map.Entry<BinaryRow, Map<Integer, List<ManifestEntry>>> part : 
afterFiles.entrySet()) {
+            for (Map.Entry<Integer, List<ManifestEntry>> bucket : 
part.getValue().entrySet()) {
+                Set<ManifestEntry> oldFiles =
+                        new HashSet<>(
+                                beforeFiles
+                                        .getOrDefault(part.getKey(), 
Collections.emptyMap())
+                                        .getOrDefault(bucket.getKey(), 
Collections.emptyList()));
+                List<Range> addedRanges = new ArrayList<>();
+                List<ManifestEntry> dependencies = new ArrayList<>();
+                for (List<ManifestEntry> group : 
ranges.mergeOverlappingRanges(bucket.getValue())) {
+                    boolean changed = false;
+                    for (ManifestEntry entry : group) {
+                        if (!oldFiles.contains(entry)) {
+                            addedRanges.add(entry.file().nonNullRowIdRange());
+                            changed = true;
+                        }
+                    }
+                    if (changed) {
+                        // Shared files still supply untouched columns and the 
current DV anchor.
+                        dependencies.addAll(group);

Review Comment:
   Fixed in `2245fd1f91`. DIFF still discovers changed RowIDs from the full 
manifest group, then applies the existing projection pruning before creating 
splits. This retains filter dependencies and the end-snapshot deletion-vector 
anchor. Sequence-number projections keep all dependencies because a newer file 
can supply the sequence number even if it supplies no projected data columns. 
The Spark 3.5.9 regression updates only b, deletes the middle row, and checks 
that reading a returns the original file path with physical positions 0 and 2. 
It also verifies the updated b values and deletion visibility.



##########
paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionBatchScan.java:
##########
@@ -497,6 +498,15 @@ private boolean queryAuthEnabled() {
     }
 
     private Optional<GlobalIndexResult> evalGlobalIndex() {
+        CoreOptions options = table.coreOptions();
+        // Incremental endpoints are resolved by batchScan, not by the 
independent index scanner.
+        if (options.startupMode() == CoreOptions.StartupMode.INCREMENTAL) {

Review Comment:
   Fixed in `2245fd1f91`. The check now uses the actual starting scanner, so 
explicit DELTA and AUTO resolved to DELTA preserve caller-supplied RowIDs and 
scores. Snapshot and tag DIFF still reject unbound results. Automatic 
historical index lookup stays disabled, and Spark-generated search results 
require a single snapshot so rankings from a newer snapshot cannot be applied 
to a historical range. The Core regression checks both modes return ID 300, 
RowID 2 and score 0.42 from the reader.



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

Reply via email to