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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DataSourceOptions.scala:
##########
@@ -787,9 +787,13 @@ object DataSourceOptionsHelper {
 
   def inferKeyGenClazz(props: TypedProperties): String = {
     val partitionFields = 
props.getString(DataSourceWriteOptions.PARTITIONPATH_FIELD.key(), null)
+    val recordsKeyFields = 
props.getString(DataSourceWriteOptions.RECORDKEY_FIELD.key(), 
DataSourceWriteOptions.RECORDKEY_FIELD.defaultValue())
+    genKeyGenerator(recordsKeyFields, partitionFields)
+  }
+
+  def genKeyGenerator(recordsKeyFields: String, partitionFields: String): 
String = {
     if (partitionFields != null) {

Review Comment:
   Let just rename `genKeyGenerator` to `inferKeyGenClazz`, it's okey because 
they have different method signature. Also can we write a test case for Spark 
SQL then ?



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