Davis-Zhang-Onehouse commented on code in PR #12583:
URL: https://github.com/apache/hudi/pull/12583#discussion_r1914181480
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/TestMergeIntoTable.scala:
##########
@@ -1336,44 +1339,59 @@ class TestMergeIntoTable extends HoodieSparkSqlTestBase
with ScalaAssertionSuppo
test("Test MergeInto with partial insert") {
spark.sql(s"set ${MERGE_SMALL_FILE_GROUP_CANDIDATES_LIMIT.key} = 0")
- Seq(true, false).foreach { sparkSqlOptimizedWrites =>
+
+ // Test combinations: (tableType, sparkSqlOptimizedWrites)
+ val testConfigs = Seq(
+ ("mor", true),
+ ("mor", false),
+ ("cow", true),
+ ("cow", false)
+ )
+
+ testConfigs.foreach { case (tableType, sparkSqlOptimizedWrites) =>
+ log.info(s"=== Testing MergeInto with partial insert:
tableType=$tableType, sparkSqlOptimizedWrites=$sparkSqlOptimizedWrites ===")
withRecordType()(withTempDir { tmp =>
spark.sql("set hoodie.payload.combined.schema.validate = true")
- // Create a partitioned mor table
+ // Create a partitioned table
val tableName = generateTableName
spark.sql(
s"""
| create table $tableName (
| id bigint,
| name string,
| price double,
+ | ts bigint,
| dt string
| ) using hudi
| tblproperties (
- | type = 'mor',
- | primaryKey = 'id'
+ | type = '$tableType',
+ | primaryKey = 'id',
+ | precombineKey = 'ts'
Review Comment:
yes, I have tried, then I hit
https://issues.apache.org/jira/browse/HUDI-8835. Precombine key is added as a
workaround for this issue. Otherwise we can wait until 8835 is triaged.
According to our last discussion, I'm waiting for you to take a look first.
Happy to triage myself, just lmk.
--
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]