Copilot commented on code in PR #3316:
URL: https://github.com/apache/fluss/pull/3316#discussion_r3245707641


##########
fluss-common/src/main/java/org/apache/fluss/row/encode/KeyEncoder.java:
##########
@@ -129,6 +130,8 @@ static KeyEncoder of(
             return CompactedKeyEncoder.createKeyEncoder(rowType, keyFields);
         } else if (lakeFormat == DataLakeFormat.ICEBERG) {
             return new IcebergKeyEncoder(rowType, keyFields);
+        } else if (lakeFormat == DataLakeFormat.HUDI) {
+            return new HudiKeyEncoder(rowType, keyFields);

Review Comment:
   This factory is used by both `ofBucketKeyEncoder` and `ofPrimaryKeyEncoder`; 
returning `HudiKeyEncoder` here makes Hudi primary keys encode to only a 4-byte 
hash. Different record keys with the same `List<String>.hashCode()` would be 
treated as the same Fluss primary key, so Hudi should be special-cased so only 
bucket-key encoding uses this lossy hash while primary-key encoding remains 
collision-free (for example via the compacted encoder).



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

Reply via email to