danny0405 commented on code in PR #8107:
URL: https://github.com/apache/hudi/pull/8107#discussion_r1159253894


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/ComplexAvroKeyGenerator.java:
##########
@@ -44,6 +48,9 @@ public ComplexAvroKeyGenerator(TypedProperties props) {
 
   @Override
   public String getRecordKey(GenericRecord record) {
+    if (autoGenerateRecordKeys()) {
+      return StringUtils.EMPTY_STRING;
+    }

Review Comment:
   I'm wondering whether we can add a new specific key generator for the 
keyless scenario, this new key generator is a wrapper for the existing key 
generator, and it masks out some invocations like:
   
   1. `#getRecordKey`, throws exception directly
   2. `#getKey`, returns a empty string for the HoodieKey record key
   
   This could avoid to introduce potential bugs and is very straight-forward.



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