gatorsmile commented on a change in pull request #26813: [SPARK-30188][SQL]
Resolve the failed unit tests when enable AQE
URL: https://github.com/apache/spark/pull/26813#discussion_r372805907
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -109,8 +112,10 @@ class DataFrameSuite extends QueryTest with
SharedSparkSession {
test("Star Expansion - CreateStruct and CreateArray") {
val structDf = testData2.select("a", "b").as("record")
// CreateStruct and CreateArray in aggregateExpressions
- assert(structDf.groupBy($"a").agg(min(struct($"record.*"))).first() ==
Row(3, Row(3, 1)))
- assert(structDf.groupBy($"a").agg(min(array($"record.*"))).first() ==
Row(3, Seq(3, 1)))
+ assert(structDf.groupBy($"a").agg(min(struct($"record.*"))).
+ sort("a").first() == Row(1, Row(1, 1)))
+ assert(structDf.groupBy($"a").agg(min(array($"record.*"))).
+ sort("a").first() == Row(1, Seq(1, 1)))
Review comment:
```
checkAnswer(structDf.groupBy($"a").agg(min(struct($"record.*"))),
Row(1, Row(1, 1)) :: Row(2, Row(2, 1)) :: Row(3, Row(3, 1)) :: Nil)
checkAnswer(structDf.groupBy($"a").agg(min(array($"record.*"))),
Row(1, Seq(1, 1)) :: Row(2, Seq(2, 1)) :: Row(3, Seq(3, 1)) :: Nil)
```
Can we directly use CheckAnswer here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]