HonahX commented on code in PR #8267:
URL: https://github.com/apache/iceberg/pull/8267#discussion_r1289558436
##########
python/pyiceberg/transforms.py:
##########
@@ -269,13 +270,9 @@ def hash_func(v: Any) -> int:
elif source_type == UUIDType:
def hash_func(v: Any) -> int:
- return mmh3.hash(
- struct.pack(
- ">QQ",
- (v.int >> 64) & 0xFFFFFFFFFFFFFFFF,
- v.int & 0xFFFFFFFFFFFFFFFF,
- )
- )
+ if isinstance(v, UUID):
+ return mmh3.hash(v.bytes)
+ return mmh3.hash(v)
Review Comment:
I found another place that could be simplified based on the above comment.
Also, I think we need to let the hash function handles `bytes` since
`transform` usually calls on literal's value and now UUIDLiteral stores `bytes`
--
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]