codope commented on code in PR #5520:
URL: https://github.com/apache/hudi/pull/5520#discussion_r880024037
##########
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:
It would be better to not rely on default value for record key. See
HUDI-3456 for example.
> In any case, I can re-scope this change to only fix hive-sync if needed.
That would be much preferable.
--
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]