linliu-code commented on code in PR #12122:
URL: https://github.com/apache/hudi/pull/12122#discussion_r1808096320


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/ddl/TestSpark3DDL.scala:
##########
@@ -755,7 +755,7 @@ class TestSpark3DDL extends HoodieSparkSqlTestBase {
 
           assertResult(StringType)(snapshotDF.schema.fields.filter(_.name == 
"fare").head.dataType)
           assertResult("addColumn")(snapshotDF.schema.fields.last.name)
-          val checkRowKey = 
dfUpdate.select("fare").collectAsList().asScala.map(_.getString(0)).head
+          val checkRowKey = 
dfUpdate.select("fare").collectAsList().asScala.map(_.getString(0)).last

Review Comment:
   This test should be flaky before. The root cause is that in the `dfUpdate`, 
there could be multiple records with the same key. We have to return the last 
one record for the same key since after `preCombined`, only the last one will 
be added to the log file, and showed in `snapshotDF`. Using `head` could cause 
the empty result in the validation.



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