nastra commented on code in PR #12821:
URL: https://github.com/apache/iceberg/pull/12821#discussion_r2058462854


##########
core/src/main/java/org/apache/iceberg/view/ViewMetadata.java:
##########
@@ -249,9 +249,17 @@ public Builder setCurrentVersionId(int newVersionId) {
         changes.add(new MetadataUpdate.SetCurrentViewVersion(newVersionId));
       }
 
+      // Use the timestamp from the view version if it was added in current 
set of changes.
+      // Otherwise, use the current system time. This handles cases where the 
view version
+      // was set as current in the past and is being re-activated.
+      boolean versionAddedInThisChange =
+          changes(MetadataUpdate.AddViewVersion.class)
+              .anyMatch(added -> added.viewVersion().versionId() == 
newVersionId);
+
       this.historyEntry =
           ImmutableViewHistoryEntry.builder()
-              .timestampMillis(version.timestampMillis())
+              .timestampMillis(

Review Comment:
   in hindsight I'm actually thinking whether it's more correct to always set 
this to `System.currentTimeMillis()` after re-reading the spec in 
https://iceberg.apache.org/view-spec/#version-log. @rdblue wdyt?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to