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

czy006 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 5d292eca5 [AMORO-4066] Fix incorrect optimizing duration calculation 
in Paimon format (#4067)
5d292eca5 is described below

commit 5d292eca509b70c70b4656d3cb3997c7c016b6f3
Author: Juntao Zhang <[email protected]>
AuthorDate: Thu Feb 5 14:36:35 2026 +0800

    [AMORO-4066] Fix incorrect optimizing duration calculation in Paimon format 
(#4067)
    
    Co-authored-by: ConradJam <[email protected]>
---
 .../amoro/formats/paimon/PaimonTableDescriptor.java  | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git 
a/amoro-format-paimon/src/main/java/org/apache/amoro/formats/paimon/PaimonTableDescriptor.java
 
b/amoro-format-paimon/src/main/java/org/apache/amoro/formats/paimon/PaimonTableDescriptor.java
index f93827658..566da688a 100644
--- 
a/amoro-format-paimon/src/main/java/org/apache/amoro/formats/paimon/PaimonTableDescriptor.java
+++ 
b/amoro-format-paimon/src/main/java/org/apache/amoro/formats/paimon/PaimonTableDescriptor.java
@@ -253,7 +253,7 @@ public class PaimonTableDescriptor implements 
FormatTableDescriptor {
             new PartitionFileBaseInfo(
                 null,
                 "BASE_FILE",
-                entry.file().creationTimeEpochMillis(),
+                getFileCreationTimeMillis(entry),
                 partitionString(entry.partition(), entry.bucket(), 
fileStorePathFactory),
                 fullFilePath(store, entry),
                 entry.file().fileSize(),
@@ -294,7 +294,7 @@ public class PaimonTableDescriptor implements 
FormatTableDescriptor {
         for (ManifestEntry manifestEntry : groupByBucketEntry.getValue()) {
           fileCount++;
           fileSize += manifestEntry.file().fileSize();
-          lastCommitTime = Math.max(lastCommitTime, 
manifestEntry.file().creationTimeEpochMillis());
+          lastCommitTime = Math.max(lastCommitTime, 
getFileCreationTimeMillis(manifestEntry));
         }
         partitionBaseInfoList.add(
             new PartitionBaseInfo(partitionSt, 0, fileCount, fileSize, 
lastCommitTime));
@@ -360,7 +360,7 @@ public class PaimonTableDescriptor implements 
FormatTableDescriptor {
           new PartitionFileBaseInfo(
               snapshotId == null ? null : snapshotId.toString(),
               "INSERT_FILE",
-              manifestEntry.file().creationTimeEpochMillis(),
+              getFileCreationTimeMillis(manifestEntry),
               partitionSt,
               0,
               fullFilePath(store, manifestEntry),
@@ -374,7 +374,7 @@ public class PaimonTableDescriptor implements 
FormatTableDescriptor {
   public Pair<List<OptimizingProcessInfo>, Integer> getOptimizingProcessesInfo(
       AmoroTable<?> amoroTable, String type, ProcessStatus status, int limit, 
int offset) {
     // Temporary solution for Paimon. TODO: Get compaction info from Paimon 
compaction task
-    List<OptimizingProcessInfo> processInfoList = new ArrayList<>();
+    List<OptimizingProcessInfo> processInfoList;
     TableIdentifier tableIdentifier = amoroTable.id();
     FileStoreTable fileStoreTable = (FileStoreTable) 
amoroTable.originalTable();
     FileStore<?> store = fileStoreTable.store();
@@ -419,12 +419,10 @@ public class PaimonTableDescriptor implements 
FormatTableDescriptor {
                         } else {
                           minCreateTime =
                               Math.min(
-                                  minCreateTime,
-                                  
compactManifestEntry.file().creationTimeEpochMillis());
+                                  minCreateTime, 
getFileCreationTimeMillis(compactManifestEntry));
                           maxCreateTime =
                               Math.max(
-                                  maxCreateTime,
-                                  
compactManifestEntry.file().creationTimeEpochMillis());
+                                  maxCreateTime, 
getFileCreationTimeMillis(compactManifestEntry));
                           
outputBuilder.addFile(compactManifestEntry.file().fileSize());
                         }
                       }
@@ -631,4 +629,10 @@ public class PaimonTableDescriptor implements 
FormatTableDescriptor {
   private FileStoreTable getTable(AmoroTable<?> amoroTable) {
     return (FileStoreTable) amoroTable.originalTable();
   }
+
+  private long getFileCreationTimeMillis(ManifestEntry manifestEntry) {
+    // DataFileMeta.creationTimeEpochMillis() may mislead user about the 
creation time
+    // See: https://github.com/apache/paimon/issues/7151
+    return manifestEntry.file().creationTime().getMillisecond();
+  }
 }

Reply via email to