jerryshao commented on code in PR #14313:
URL: https://github.com/apache/gravitino/pull/14313#discussion_r4509211342


##########
catalogs/catalog-lakehouse-iceberg/src/main/java/org/apache/gravitino/catalog/lakehouse/iceberg/IcebergViewCatalogOperations.java:
##########
@@ -404,14 +404,16 @@ private static List<MetadataUpdate> 
buildNewViewVersionUpdates(
       newRepresentations.add(toSqlViewRepresentation(representation));
     }
 
+    long timestampMillis = System.currentTimeMillis();
     ViewVersion newVersion =
         ImmutableViewVersion.builder()
             .versionId(newVersionId)
-            .timestampMillis(System.currentTimeMillis())
+            .timestampMillis(timestampMillis)
             .schemaId(schemaId)
             .defaultNamespace(defaultNamespace)
             .representations(newRepresentations)
             .putSummary("operation", "alter")
+            .putSummary("timestamp-ms", Long.toString(timestampMillis))

Review Comment:
   Iceberg ignores version id and timestamp when matching versions, so this 
summary entry is the only thing keeping versions distinct. Two identical 
replacements in the same millisecond still produce equal versions and the 
original failure; use a value guaranteed unique per call (for example a UUID or 
a counter bumped past the current version timestamp).



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