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


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/UpdateHoodieTableCommand.scala:
##########
@@ -31,6 +34,22 @@ import org.apache.spark.sql.hudi.ProvidesHoodieConfig
 case class UpdateHoodieTableCommand(ut: UpdateTable) extends 
HoodieLeafRunnableCommand
   with SparkAdapterSupport with ProvidesHoodieConfig {
 
+  private def buildUpdateConfig( sparkSession: SparkSession,
+                                    hoodieCatalogTable: HoodieCatalogTable): 
Map[String, String] = {
+    val optimizedWrite = 
sparkSession.sqlContext.conf.getConfString(SPARK_SQL_OPTIMIZED_WRITES.key()
+      , SPARK_SQL_OPTIMIZED_WRITES.defaultValue()) == "true"
+    val shouldCombine = 
!StringUtils.isNullOrEmpty(hoodieCatalogTable.preCombineKey.getOrElse(""))
+
+    if (!shouldCombine && 
hoodieCatalogTable.tableType.name().equals("MERGE_ON_READ")) {
+      throw new HoodieException("Precombine field must be set for 
MERGE_ON_READ table type to execute UPDATE statement.")

Review Comment:
   Does it mean only COW table supports this?



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to