anoopj commented on code in PR #16294:
URL: https://github.com/apache/iceberg/pull/16294#discussion_r3658540862


##########
format/spec.md:
##########
@@ -1908,6 +1910,12 @@ Reading v4 metadata:
 * Relative paths must be resolved against the table location before use (see 
[Path Resolution](#path-resolution))
 * When `location` is omitted, the table location must be provided (see [Table 
Location Specification](#table-location-specification))
 
+Snapshot timestamp changes:
+
+* A snapshot's `timestamp-ms` must be strictly greater than the `timestamp-ms` 
of its parent snapshot on the same branch.

Review Comment:
   Thanks for adding this. BTW this is almost identical to Delta Lake's 
[In-commit 
timestamps](https://github.com/delta-io/delta/blob/master/PROTOCOL.md#in-commit-timestamps)
 feature which also adds Lamport clocks to commits.



##########
format/spec.md:
##########
@@ -960,6 +960,8 @@ A snapshot consists of the following fields:
     |            |            | _required_ | **`added-rows`**             | 
The upper bound of the number of rows with assigned row IDs, see [Row 
Lineage](#row-lineage) |
     |            |            | _optional_ | **`key-id`**                 | ID 
of the encryption key that encrypts the manifest list key metadata |
 
+In format version 4 and above, a snapshot's `timestamp-ms` must be strictly 
greater than the `timestamp-ms` of its parent snapshot on the same branch. The 
requirement applies only to snapshots committed while the table is at format 
version 4 or higher; root snapshots, and snapshots that existed before a table 
was upgraded to v4, are not constrained.

Review Comment:
   The rule says it "applies only to snapshots committed while the table is at 
format version 4 or higher," but as far as I can tell nothing durably records 
where that boundary is with v4 snapshots and old grandfathered v3 snapshots. 
   
   In Delta, we record the enablement point so readers can identify the 
boundary. 
   
   Maybe we can optionally add a sentence to the reader-facing part of the spec 
stating that pre-v4 snapshots may violate monotonicity and readers must not 
assume the full snapshot chain is monotonic.  (for time travel purposes)



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