cloud-fan commented on a change in pull request #26437: [SPARK-29800][SQL]
Rewrite non-correlated subquery use ScalaSubquery to optimize perf
URL: https://github.com/apache/spark/pull/26437#discussion_r362742121
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
##########
@@ -1034,14 +1034,16 @@ class SubquerySuite extends QueryTest with
SharedSparkSession {
test("SPARK-21835: Join in correlated subquery should be duplicateResolved:
case 1") {
withTable("t1") {
withTempPath { path =>
- Seq(1 -> "a").toDF("i", "j").write.parquet(path.getCanonicalPath)
- sql(s"CREATE TABLE t1 USING parquet LOCATION '${path.toURI}'")
+ Seq(1 -> "a").toDF("i", "j").write.parquet(path.getCanonicalPath +
"/t1")
+ Seq(2 -> "b").toDF("i", "j").write.parquet(path.getCanonicalPath +
"/t2")
+ sql(s"CREATE TABLE t1 USING parquet LOCATION '${path.toURI}/t1'")
+ sql(s"CREATE TABLE t2 USING parquet LOCATION '${path.toURI}/t2'")
val sqlText =
"""
|SELECT * FROM t1
|WHERE
- |NOT EXISTS (SELECT * FROM t1)
+ |NOT EXISTS (SELECT * FROM t2 WHERE t1.i = t2.i)
Review comment:
this test is testing self join intentionally. how about
```
SELECT * FROM t1 left
WHERE
NOT EXISTS (SELECT * FROM t1 right WHERE left.i = right.i)
```
----------------------------------------------------------------
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]