Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/11190#discussion_r52824062
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
---
@@ -2105,6 +2105,18 @@ class SQLQuerySuite extends QueryTest with
SharedSQLContext {
assert(error.getMessage contains "grouping_id() can only be used with
GroupingSets/Cube/Rollup")
}
+ test("uncorrelated scalar subquery") {
+ assertResult(Array(Row(1))) {
+ sql("select (select 1 as b) as b").collect()
+ }
+
+ assertResult(Array(Row(1))) {
+ sql("with t2 as (select 1 as b, 2 as c) " +
+ "select a from (select 1 as a union all select 2 as a) t " +
+ "where a = (select max(b) from t2) ").collect()
--- End diff --
Added
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]