liurenjie1024 commented on code in PR #12334:
URL: https://github.com/apache/iceberg/pull/12334#discussion_r1968725930


##########
format/spec.md:
##########
@@ -1754,6 +1754,14 @@ Snapshot summary can include metrics fields to track 
numeric stats of the snapsh
 | **`engine-name`**        | "spark"    | Name of the engine that created the 
snapshot                    |
 | **`engine-version`**     | "3.5.4"    | Version of the engine that created 
the snapshot                 |
 
+### Assignment of Snapshot IDs and `current-snapshot-id`
+
+Writers should produce positive values for snapshot ids in a manner that 
minimizes the probability of id collisions and should verify the id does not 
conflict with existing snapshots. Producing snapshot ids based on timestamps 
alone is not recommended as it increases the potential for collisions.
+
+The reference implementation uses a type 4 uuid and XORs the 4 most 
significant bytes with the 4 least significant bytes then ANDs with the maximum 
long value to arrive at a pseudo-random snapshot id with a low probability of 
collision.

Review Comment:
   ```suggestion
   The reference Java implementation uses a type 4 uuid and XORs the 4 most 
significant bytes with the 4 least significant bytes then ANDs with the maximum 
long value to arrive at a pseudo-random snapshot id with a low probability of 
collision.
   ```



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