wangyum opened a new pull request #32216:
URL: https://github.com/apache/spark/pull/32216
### What changes were proposed in this pull request?
This pr makes propagate empty relation through Join if join condition is
empty. For example:
```scala
spark.sql("create table t1 using parquet as select id as a, id as b from
range(10)")
spark.sql("create table t2 using parquet as select id as a, id as b from
range(20)")
spark.sql("select t1.a from t1 left anti join t2").explain(true)
```
Before this pr:
```
== Optimized Logical Plan ==
Join LeftAnti
:- Project [a#6L]
: +- Relation default.t1[a#6L,b#7L] parquet
+- Project
+- Relation default.t2[a#8L,b#9L] parquet
```
After this pr:
```
== Optimized Logical Plan ==
LocalRelation <empty>, [a#6L]
```
### Why are the changes needed?
Improve query performance.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Unit 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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]