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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DataSourceOptions.scala:
##########
@@ -788,11 +788,11 @@ 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)
+    inferKeyGenClazz(recordsKeyFields, partitionFields)
   }
 
-  def genKeyGenerator(recordsKeyFields: String, partitionFields: String): 
String = {
-    if (partitionFields != null) {
+  def inferKeyGenClazz(recordsKeyFields: String, partitionFields: String): 
String = {
+    if (!StringUtils.isNullOrEmpty(partitionFields)) {

Review Comment:
   Hi @danny0405 , seems we should judge empty "" for this, else we cannot get 
`NonpartitionedKeyGenerator` in any situation.



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