codope commented on code in PR #7668:
URL: https://github.com/apache/hudi/pull/7668#discussion_r1086228289


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/InsertIntoHoodieTableCommand.scala:
##########
@@ -18,7 +18,7 @@
 package org.apache.spark.sql.hudi.command
 
 import org.apache.hudi.exception.HoodieException
-import org.apache.hudi.{HoodieSparkSqlWriter, SparkAdapterSupport}
+import org.apache.hudi.{DataSourceWriteOptions, HoodieSparkSqlWriter, 
SparkAdapterSupport}

Review Comment:
   nit: unused import



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/SimpleKeyGenerator.java:
##########
@@ -126,8 +126,8 @@ private static void validatePartitionPath(String 
partitionPathField) {
         String.format("Single partition-path field is expected; provided 
(%s)", partitionPathField));
   }
 
-  private static void validateRecordKey(String recordKeyField) {
-    checkArgument(recordKeyField == null || !recordKeyField.isEmpty(),
+  private static void validateRecordKey(String recordKeyField, boolean 
isAutoGenerateRecordKeyEnabled) {
+    checkArgument(recordKeyField == null || !recordKeyField.isEmpty() || 
isAutoGenerateRecordKeyEnabled,

Review Comment:
   Should the validation on record key field be:
   1. It is not empty.
   2. Or, `isAutoGenerateRecordKeyEnabled`.
   
   I am assuming record key field can be null only when 
`isAutoGenerateRecordKeyEnabled` is true. We can take it as a followup after 
confirming why null record key field was allowed in the first place.



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