codope commented on code in PR #5520:
URL: https://github.com/apache/hudi/pull/5520#discussion_r871278650
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/ComplexKeyGenerator.java:
##########
@@ -37,14 +36,10 @@ public class ComplexKeyGenerator extends
BuiltinKeyGenerator {
public ComplexKeyGenerator(TypedProperties props) {
super(props);
- this.recordKeyFields =
Arrays.stream(props.getString(KeyGeneratorOptions.RECORDKEY_FIELD_NAME.key()).split(","))
- .map(String::trim)
- .filter(s -> !s.isEmpty())
- .collect(Collectors.toList());
- this.partitionPathFields =
Arrays.stream(props.getString(KeyGeneratorOptions.PARTITIONPATH_FIELD_NAME.key()).split(","))
- .map(String::trim)
- .filter(s -> !s.isEmpty())
- .collect(Collectors.toList());
+ this.recordKeyFields =
props.getStringList(KeyGeneratorOptions.RECORDKEY_FIELD_NAME.key(), ",",
+
Collections.singletonList(KeyGeneratorOptions.RECORDKEY_FIELD_NAME.defaultValue()));
Review Comment:
This behavior change may not be compatible. `RECORDKEY_FIELD_NAME` has a
default value. In the unlikely event that user does not set this config, it
will result in `uuid` being default and this field may not be part of schema.
Without this change, an exception would be thrown.
--
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]