yihua commented on code in PR #12583:
URL: https://github.com/apache/hudi/pull/12583#discussion_r1914163357
##########
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:
My point is that we should not add more config or constraint in the test
that make it more specific, if not necessary. The test passes without setting
`precombineKey` before. Could we try that? If some case fails, let's
understand why.
--
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]