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


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/TestPartialUpdateForMergeInto.scala:
##########
@@ -594,6 +594,55 @@ class TestPartialUpdateForMergeInto extends 
HoodieSparkSqlTestBase {
     )
   }
 
+  test("Test MergeInto Partial Updates should fail with CUSTOM payload and 
merge mode") {
+    withTempDir { tmp =>
+      withSQLConf(
+        "hoodie.index.type" -> "GLOBAL_SIMPLE",
+        "hoodie.write.record.merge.mode" -> "CUSTOM",
+        "hoodie.datasource.write.payload.class" -> 
"org.apache.hudi.common.testutils.reader.HoodieRecordTestPayload") {
+        val tableName = generateTableName
+        spark.sql(
+          s"""
+             | CREATE TABLE $tableName (
+             |   record_key STRING,
+             |   name STRING,
+             |   age INT,
+             |   department STRING,
+             |   salary DOUBLE,
+             |   ts BIGINT
+             | ) USING hudi
+             | PARTITIONED BY (department)
+             | LOCATION '${tmp.getCanonicalPath}'
+             | TBLPROPERTIES (
+             |   type = 'mor',
+             |   primaryKey = 'record_key',
+             |   preCombineField = 'ts')""".stripMargin)
+
+        spark.sql(
+          s"""
+             | INSERT INTO $tableName
+             | SELECT * FROM (
+             |   SELECT 'emp_001' as record_key, 'John Doe' as name, 30 as age,
+             |          'Sales' as department, 80000.0 as salary, 1598886000 
as ts
+             |   UNION ALL
+             |   SELECT 'emp_002', 'Jane Smith', 28, 'Sales', 75000.0, 
1598886001
+             |   UNION ALL
+             |   SELECT 'emp_003', 'Bob Wilson', 35, 'Marketing', 85000.0, 
1598886002
+             |)""".stripMargin)
+
+        val failedToResolveError = "MERGE INTO field resolution error: No 
matching assignment found for target table"

Review Comment:
   we could.. need more boolean flags in the code for fine grained error 
messages.



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