yihua commented on code in PR #19304:
URL: https://github.com/apache/hudi/pull/19304#discussion_r4102683033


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -780,6 +783,7 @@ class HoodieSparkSqlWriterInternal {
           .setTableType(HoodieTableType.valueOf(tableType))
           .setTableName(tableName)
           .setRecordKeyFields(recordKeyFields)
+          
.setComplexKeyGenEncoding(explicitComplexKeyGenEncoding(hoodieConfig))

Review Comment:
   Same here as above



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/HoodieStreamerUtils.java:
##########
@@ -116,7 +116,8 @@ public static Option<JavaRDD<HoodieRecord>> 
createHoodieRecords(HoodieStreamer.C
                 
props.setProperty(KeyGenUtils.RECORD_KEY_GEN_PARTITION_ID_CONFIG, 
String.valueOf(TaskContext.getPartitionId()));
                 
props.setProperty(KeyGenUtils.RECORD_KEY_GEN_INSTANT_TIME_CONFIG, instantTime);
               }
-              BuiltinKeyGenerator builtinKeyGenerator = (BuiltinKeyGenerator) 
HoodieSparkKeyGeneratorFactory.createKeyGenerator(props);
+              BuiltinKeyGenerator builtinKeyGenerator = (BuiltinKeyGenerator) 
HoodieSparkKeyGeneratorFactory.createKeyGenerator(
+                  
KeyGenUtils.withComplexKeyGenEncoding(TypedProperties.copy(props), 
tableConfig));

Review Comment:
   Have all places creating key generator been enhanced with the new keygen 
encoding config?



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -321,6 +321,7 @@ class HoodieSparkSqlWriterInternal {
           .setPopulateMetaFields(populateMetaFields)
           .setMetaFieldsModeFromString(metaFieldsMode)
           .setRecordKeyFields(hoodieConfig.getString(RECORDKEY_FIELD))
+          
.setComplexKeyGenEncoding(explicitComplexKeyGenEncoding(hoodieConfig))

Review Comment:
   Should this be set only if the complex keygen and a single record key field 
are used, to avoid confusion?  Also, should other caller of 
`HoodieTableMetaClient.newTableBuilder()` be revisited on the same?  Does this 
control table config to write or different?



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