XiaoHongbo-Hope commented on code in PR #7093:
URL: https://github.com/apache/paimon/pull/7093#discussion_r2712323977


##########
paimon-core/src/main/java/org/apache/paimon/table/source/snapshot/SnapshotReaderImpl.java:
##########
@@ -505,68 +508,84 @@ private Plan toChangesPlan(
                                 .getOrDefault(part, Collections.emptyMap())
                                 .getOrDefault(bucket, Collections.emptyList());
                 List<ManifestEntry> dataEntries =
-                        dataFiles
+                        afterFiles
                                 .getOrDefault(part, Collections.emptyMap())
                                 .getOrDefault(bucket, Collections.emptyList());
 
-                // deduplicate
-                beforeEntries.removeIf(dataEntries::remove);
-
                 Integer totalBuckets = null;
                 if (!dataEntries.isEmpty()) {
                     totalBuckets = dataEntries.get(0).totalBuckets();
                 } else if (!beforeEntries.isEmpty()) {
                     totalBuckets = beforeEntries.get(0).totalBuckets();
                 }
 
+                // deduplicate
+                beforeEntries.removeIf(dataEntries::remove);
+
                 List<DataFileMeta> before =
                         beforeEntries.stream()
                                 .map(ManifestEntry::file)
                                 .collect(Collectors.toList());
-                List<DataFileMeta> data =
+                List<DataFileMeta> after =
                         
dataEntries.stream().map(ManifestEntry::file).collect(Collectors.toList());
 
-                DataSplit.Builder builder =
-                        DataSplit.builder()
-                                .withSnapshot(snapshot.id())
-                                .withPartition(part)
-                                .withBucket(bucket)
-                                .withTotalBuckets(totalBuckets)
-                                .withBeforeFiles(before)
-                                .withDataFiles(data)
-                                .isStreaming(isStreaming)
-                                .withBucketPath(pathFactory.bucketPath(part, 
bucket).toString());
+                List<DeletionFile> beforeDeletionFiles = null;
                 if (deletionVectors && beforeDeletionFilesMap != null) {
-                    builder.withBeforeDeletionFiles(
+                    beforeDeletionFiles =
                             getDeletionFiles(
                                     before,
                                     beforeDeletionFilesMap.getOrDefault(
-                                            Pair.of(part, bucket), 
Collections.emptyMap())));
+                                            Pair.of(part, bucket), 
Collections.emptyMap()));
                 }
-                if (deletionVectors && deletionFilesMap != null) {
-                    builder.withDataDeletionFiles(
+
+                List<DeletionFile> afterDeletionFiles = null;
+                if (deletionVectors && afterDeletionFilesMap != null) {
+                    afterDeletionFiles =
                             getDeletionFiles(
-                                    data,
-                                    deletionFilesMap.getOrDefault(
-                                            Pair.of(part, bucket), 
Collections.emptyMap())));
+                                    after,
+                                    afterDeletionFilesMap.getOrDefault(
+                                            Pair.of(part, bucket), 
Collections.emptyMap()));
                 }
-                splits.add(builder.build());
+
+                if (totalBuckets == null) {
+                    System.out.println("");

Review Comment:
   debug code left



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