jackye1995 commented on code in PR #7450:
URL: https://github.com/apache/iceberg/pull/7450#discussion_r1179581773


##########
delta-lake/src/main/java/org/apache/iceberg/delta/BaseSnapshotDeltaLakeTableAction.java:
##########
@@ -412,6 +426,25 @@ private Map<String, String> destTableProperties(
     return additionalPropertiesBuilder.build();
   }
 
+  private void tagCurrentSnapshot(long deltaVersion, Transaction transaction) {
+    long currentSnapshotId = 
transaction.table().currentSnapshot().snapshotId();
+
+    ManageSnapshots manageSnapshots = transaction.manageSnapshots();
+    manageSnapshots.createTag(DELTA_VERSION_TAG_PREFIX + deltaVersion, 
currentSnapshotId);
+
+    Timestamp deltaVersionTimestamp = 
deltaLog.getCommitInfoAt(deltaVersion).getTimestamp();
+    if (deltaVersionTimestamp != null) {
+      String formattedDeltaTimestamp =
+          deltaVersionTimestamp
+              .toInstant()
+              .atZone(ZoneId.of(DELTA_TIME_STAMP_ZONE))
+              .format(DateTimeFormatter.ofPattern(DELTA_TIME_STAMP_FORMAT));

Review Comment:
   Thought about this a bit more, I think I would +1 for just using raw 
millisecond timestamp. Dealing with timezone is complex and should be avoided 
if there is no significant benefit. Also it leaves a space character in the 
tag, that might cause issue.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to