openinx commented on a change in pull request #2506:
URL: https://github.com/apache/iceberg/pull/2506#discussion_r619942779
##########
File path: core/src/main/java/org/apache/iceberg/TableOperations.java
##########
@@ -117,7 +117,7 @@ default long newSnapshotId() {
UUID uuid = UUID.randomUUID();
long mostSignificantBits = uuid.getMostSignificantBits();
long leastSignificantBits = uuid.getLeastSignificantBits();
- return Math.abs(mostSignificantBits ^ leastSignificantBits);
+ return (mostSignificantBits ^ leastSignificantBits) & Long.MAX_VALUE;
Review comment:
I'm curious whether are there two different `UUID` whose
`Math.abs(mostSignificantBits ^ leastSignificantBits)` are the same. If so,
then we will encounter a duplicated new snapshot id which could be a serious
bug ?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]