yihua commented on code in PR #13263:
URL: https://github.com/apache/hudi/pull/13263#discussion_r2076523436
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/TestPartialUpdateForMergeInto.scala:
##########
@@ -54,6 +54,10 @@ class TestPartialUpdateForMergeInto extends
HoodieSparkSqlTestBase {
testPartialUpdate("mor", "parquet")
}
+ test("Test partial update with MOR and Parquet log format and commit time
ordering") {
Review Comment:
Let's test Avro log block too? and the cases for both updates and inserts.
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/TestPartialUpdateForMergeInto.scala:
##########
@@ -296,21 +312,48 @@ class TestPartialUpdateForMergeInto extends
HoodieSparkSqlTestBase {
spark.sql(
s"""
|merge into $tableName t0
- |using ( select 1 as id, 'a1' as name, 12.0 as price, 1001 as ts
+ |using ( select 1 as id, 'a1' as name, 12.0 as price, 999 as ts
|union select 3 as id, 'a3' as name, 25.0 as price, 1260 as ts) s0
|on t0.id = s0.id
|when matched then update set price = s0.price, _ts = s0.ts
|""".stripMargin)
-
validateTableSchema(tableName, structFields)
+ if (commitTimeOrdering) {
+ checkAnswer(s"select id, name, price, _ts, description from
$tableName")(
+ Seq(1, "a1", 12.0, 999, "a1: desc1"),
+ Seq(2, "a2", 20.0, 1200, "a2: desc2"),
+ Seq(3, "a3", 25.0, 1260, "a3: desc3")
+ )
+ } else {
+ checkAnswer(s"select id, name, price, _ts, description from
$tableName")(
+ Seq(1, "a1", 10.0, 1000, "a1: desc1"),
+ Seq(2, "a2", 20.0, 1200, "a2: desc2"),
+ Seq(3, "a3", 25.0, 1260, "a3: desc3")
+ )
+ }
+ if (tableType.equals("mor")) {
+ validateLogBlock(basePath, 1, Seq(Seq("price", "_ts")), true)
+ }
+
+
Review Comment:
remove: redundant empty line
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/TestPartialUpdateForMergeInto.scala:
##########
@@ -278,7 +293,8 @@ class TestPartialUpdateForMergeInto extends
HoodieSparkSqlTestBase {
|tblproperties(
| type ='$tableType',
| primaryKey = 'id',
- | preCombineField = '_ts'
+ | preCombineField = '_ts',
Review Comment:
Remove precombine config for commit-time ordering
--
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]