This is an automated email from the ASF dual-hosted git repository.

jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a028d7ac [AMORO-3348] Using the same snapshot id to scan delete files 
(#3349)
8a028d7ac is described below

commit 8a028d7acec3c21620ee88e6c161465d1724c1b9
Author: Qishang Zhong <[email protected]>
AuthorDate: Fri Dec 6 15:05:28 2024 +0800

    [AMORO-3348] Using the same snapshot id to scan delete files (#3349)
---
 .../main/java/org/apache/amoro/server/utils/IcebergTableUtil.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/amoro-ams/src/main/java/org/apache/amoro/server/utils/IcebergTableUtil.java 
b/amoro-ams/src/main/java/org/apache/amoro/server/utils/IcebergTableUtil.java
index 0ef42e6c9..0df063725 100644
--- 
a/amoro-ams/src/main/java/org/apache/amoro/server/utils/IcebergTableUtil.java
+++ 
b/amoro-ams/src/main/java/org/apache/amoro/server/utils/IcebergTableUtil.java
@@ -149,8 +149,9 @@ public class IcebergTableUtil {
     if (internalTable.currentSnapshot() == null) {
       return Collections.emptySet();
     }
+    long snapshotId = internalTable.currentSnapshot().snapshotId();
     Set<String> deleteFilesPath = new HashSet<>();
-    TableScan tableScan = internalTable.newScan();
+    TableScan tableScan = internalTable.newScan().useSnapshot(snapshotId);
     try (CloseableIterable<FileScanTask> fileScanTasks = 
tableScan.planFiles()) {
       for (FileScanTask fileScanTask : fileScanTasks) {
         for (DeleteFile delete : fileScanTask.deletes()) {
@@ -165,7 +166,7 @@ public class IcebergTableUtil {
     Set<DeleteFile> danglingDeleteFiles = new HashSet<>();
     TableEntriesScan entriesScan =
         TableEntriesScan.builder(internalTable)
-            .useSnapshot(internalTable.currentSnapshot().snapshotId())
+            .useSnapshot(snapshotId)
             .includeFileContent(FileContent.EQUALITY_DELETES, 
FileContent.POSITION_DELETES)
             .build();
     try (CloseableIterable<IcebergFileEntry> entries = entriesScan.entries()) {

Reply via email to