amaliujia commented on code in PR #38052:
URL: https://github.com/apache/spark/pull/38052#discussion_r985131060
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -4513,6 +4513,16 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession with AdaptiveSpark
}
}
}
+
+ test("SPARK-40618: Regression test for merging subquery bug with nested
subqueries") {
+ // This test contains a subquery expression with another subquery
expression nested inside.
+ // It acts as a regression test to ensure that the MergeScalarSubqueries
rule does not attempt
+ // to merge them together.
+ withTable("t") {
+ sql("create table t(col int) using csv")
+ checkAnswer(sql("select(select sum((select sum(col) from t)) from t)"),
Row(null))
Review Comment:
Nit: there is a `SubquerySuite` which might be a better place to host this
test?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]