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

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

commit 31362967961d2e19df336cf242a849f29f156927
Author: JingsongLi <[email protected]>
AuthorDate: Tue Dec 30 17:27:28 2025 +0800

    [core] Add compactIndexFiles to ManifestEntryChanges.changedPartitions
---
 .../main/java/org/apache/paimon/utils/ListUtils.java    |  7 +++++++
 .../apache/paimon/operation/FileStoreCommitImpl.java    |  5 +++--
 .../paimon/operation/commit/ManifestEntryChanges.java   | 17 ++++++++---------
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/paimon-common/src/main/java/org/apache/paimon/utils/ListUtils.java 
b/paimon-common/src/main/java/org/apache/paimon/utils/ListUtils.java
index 433e3a0d0f..bd35c3798c 100644
--- a/paimon-common/src/main/java/org/apache/paimon/utils/ListUtils.java
+++ b/paimon-common/src/main/java/org/apache/paimon/utils/ListUtils.java
@@ -46,4 +46,11 @@ public class ListUtils {
         }
         return result;
     }
+
+    public static <E> List<E> union(List<? extends E> list1, List<? extends E> 
list2) {
+        ArrayList<E> result = new ArrayList<>(list1.size() + list2.size());
+        result.addAll(list1);
+        result.addAll(list2);
+        return result;
+    }
 }
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
 
b/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
index 9933e40250..2ab7023133 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
@@ -352,7 +352,8 @@ public class FileStoreCommitImpl implements FileStoreCommit 
{
                                     changedPartitions(
                                             changes.appendTableFiles,
                                             changes.compactTableFiles,
-                                            changes.appendIndexFiles)));
+                                            changes.appendIndexFiles,
+                                            changes.compactIndexFiles)));
                     if (discardDuplicate) {
                         Set<FileEntry.Identifier> baseIdentifiers =
                                 baseEntries.stream()
@@ -897,7 +898,7 @@ public class FileStoreCommitImpl implements FileStoreCommit 
{
             // latestSnapshotId is different from the snapshot id we've 
checked for conflicts,
             // so we have to check again
             List<BinaryRow> changedPartitions =
-                    changedPartitions(deltaFiles, Collections.emptyList(), 
indexFiles);
+                    changedPartitions(deltaFiles, emptyList(), indexFiles, 
emptyList());
             if (retryResult != null && retryResult.latestSnapshot != null) {
                 baseDataFiles = new ArrayList<>(retryResult.baseDataFiles);
                 List<SimpleFileEntry> incremental =
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/operation/commit/ManifestEntryChanges.java
 
b/paimon-core/src/main/java/org/apache/paimon/operation/commit/ManifestEntryChanges.java
index 794445dfbb..4e1bcd5361 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/operation/commit/ManifestEntryChanges.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/operation/commit/ManifestEntryChanges.java
@@ -25,6 +25,7 @@ import org.apache.paimon.manifest.IndexManifestEntry;
 import org.apache.paimon.manifest.ManifestEntry;
 import org.apache.paimon.table.sink.CommitMessage;
 import org.apache.paimon.table.sink.CommitMessageImpl;
+import org.apache.paimon.utils.ListUtils;
 
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -165,17 +166,15 @@ public class ManifestEntryChanges {
     public static List<BinaryRow> changedPartitions(
             List<ManifestEntry> appendTableFiles,
             List<ManifestEntry> compactTableFiles,
-            List<IndexManifestEntry> appendIndexFiles) {
+            List<IndexManifestEntry> appendIndexFiles,
+            List<IndexManifestEntry> compactIndexFiles) {
         Set<BinaryRow> changedPartitions = new HashSet<>();
-        for (ManifestEntry appendTableFile : appendTableFiles) {
-            changedPartitions.add(appendTableFile.partition());
+        for (ManifestEntry file : ListUtils.union(appendTableFiles, 
compactTableFiles)) {
+            changedPartitions.add(file.partition());
         }
-        for (ManifestEntry compactTableFile : compactTableFiles) {
-            changedPartitions.add(compactTableFile.partition());
-        }
-        for (IndexManifestEntry appendIndexFile : appendIndexFiles) {
-            if 
(appendIndexFile.indexFile().indexType().equals(DELETION_VECTORS_INDEX)) {
-                changedPartitions.add(appendIndexFile.partition());
+        for (IndexManifestEntry file : ListUtils.union(appendIndexFiles, 
compactIndexFiles)) {
+            if (file.indexFile().indexType().equals(DELETION_VECTORS_INDEX)) {
+                changedPartitions.add(file.partition());
             }
         }
         return new ArrayList<>(changedPartitions);

Reply via email to