francis0407 commented on a change in pull request #24321: [SPARK-27411][SQL]
DataSourceV2Strategy should not eliminate subquery
URL: https://github.com/apache/spark/pull/24321#discussion_r273425352
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2Suite.scala
##########
@@ -392,6 +392,16 @@ class DataSourceV2Suite extends QueryTest with
SharedSQLContext {
}
}
}
+
+ test("SPARK-27411: DataSourceV2Strategy should not eliminate subquery") {
+ val t2 = spark.read.format(classOf[SimpleDataSourceV2].getName).load()
+ sql("create temporary view t1 (a int) using parquet")
+ val df = t2.where("i < (select max(a) from t1)")
+ val subqueries = df.queryExecution.executedPlan.collect {
+ case p => p.subqueries
+ }.flatten
+ assert(subqueries.length == 1)
Review comment:
Sure, thanks.
----------------------------------------------------------------
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]