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 fda105e47 [Hotfix] Fix incorrect Last Commit Time showing year 58000+
in partition view (#4083)
fda105e47 is described below
commit fda105e47e5034b5e4d033ec69f2244b7b20c1c6
Author: Jiwon Park <[email protected]>
AuthorDate: Thu Feb 12 12:14:38 2026 +0900
[Hotfix] Fix incorrect Last Commit Time showing year 58000+ in partition
view (#4083)
The last_updated_at column from Iceberg PARTITIONS metadata table stores
timestamps in microseconds, but it was passed directly to the frontend
which expects milliseconds. This caused the displayed year to be ~58000.
Convert microseconds to milliseconds by dividing by 1000, consistent
with how snapshot.timestampMillis() is used elsewhere.
Signed-off-by: Jiwon Park <[email protected]>
---
.../server/dashboard/MixedAndIcebergTableDescriptor.java | 4 +++-
.../server/dashboard/TestIcebergServerTableDescriptor.java | 11 ++++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git
a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java
b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java
index 19627f86f..7f3a49d0c 100644
---
a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java
+++
b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java
@@ -553,7 +553,9 @@ public class MixedAndIcebergTableDescriptor extends
PersistentBase
// This will be updated once Iceberg supports reporting delete
file sizes.
// See: https://github.com/apache/iceberg/issues/14803
partitionInfo.setFileSize(totalDataFileSize != null ?
totalDataFileSize : 0L);
- partitionInfo.setLastCommitTime(lastUpdatedAt != null ?
lastUpdatedAt : 0L);
+ // last_updated_at from Iceberg PARTITIONS metadata table is in
microseconds,
+ // convert to milliseconds for consistency with
snapshot.timestampMillis()
+ partitionInfo.setLastCommitTime(lastUpdatedAt != null ?
lastUpdatedAt / 1000 : 0L);
partitions.add(partitionInfo);
}
diff --git
a/amoro-ams/src/test/java/org/apache/amoro/server/dashboard/TestIcebergServerTableDescriptor.java
b/amoro-ams/src/test/java/org/apache/amoro/server/dashboard/TestIcebergServerTableDescriptor.java
index 265a5700d..4b9d6b296 100644
---
a/amoro-ams/src/test/java/org/apache/amoro/server/dashboard/TestIcebergServerTableDescriptor.java
+++
b/amoro-ams/src/test/java/org/apache/amoro/server/dashboard/TestIcebergServerTableDescriptor.java
@@ -107,15 +107,20 @@ public class TestIcebergServerTableDescriptor extends
TestServerTableDescriptor
Assert.assertEquals("Should have 1 file total", 1, totalFiles);
// Verify we used PARTITIONS metadata table which provides fileSize and
lastCommitTime
+ // Year 2100 in milliseconds - any reasonable timestamp must be below this
+ long year2100InMillis = 4102444800000L;
for (org.apache.amoro.table.descriptor.PartitionBaseInfo partition :
partitions) {
// File size should be available from PARTITIONS metadata table
Assert.assertTrue(
"FileSize should be available from PARTITIONS metadata table",
partition.getFileSize() >= 0);
- // Last commit time should be available from PARTITIONS metadata table
+ // Last commit time should be available and in milliseconds (not
microseconds)
+ Assert.assertTrue("LastCommitTime should be positive",
partition.getLastCommitTime() > 0);
Assert.assertTrue(
- "LastCommitTime should be available from PARTITIONS metadata table",
- partition.getLastCommitTime() >= 0);
+ "LastCommitTime should be in milliseconds, not microseconds (got "
+ + partition.getLastCommitTime()
+ + ")",
+ partition.getLastCommitTime() < year2100InMillis);
}
}