FailedChanges

Summary

  1. [SPARK-29800][SQL] Rewrite non-correlated EXISTS subquery use (details)
Commit 3eade744f8ac1f6474cba0b3c755879f54c2f5c3 by wenchen
[SPARK-29800][SQL] Rewrite non-correlated EXISTS subquery use
ScalaSubquery to optimize perf
### What changes were proposed in this pull request?
Current catalyst rewrite non-correlated exists subquery to
BroadcastNestLoopJoin, it's performance is not good , now we rewrite
non-correlated EXISTS subquery to ScalaSubquery to optimize the
performance. We rewrite
```
WHERE EXISTS (SELECT A FROM TABLE B WHERE COL1 > 10)
``` to
```
WHERE (SELECT 1 FROM (SELECT A FROM TABLE B WHERE COL1 > 10) LIMIT 1) IS
NOT NULL
``` to avoid build join to solve EXISTS expression.
### Why are the changes needed? Optimize EXISTS performance.
### Does this PR introduce any user-facing change? NO
### How was this patch tested? Manuel Tested
Closes #26437 from AngersZhuuuu/SPARK-29800.
Lead-authored-by: angerszhu <angers.zhu@gmail.com> Co-authored-by:
AngersZhuuuu <angers.zhu@gmail.com> Signed-off-by: Wenchen Fan
<wenchen@databricks.com>
The file was modifiedsql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala (diff)
The file was modifiedsql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala (diff)