wangyum opened a new pull request #32218:
URL: https://github.com/apache/spark/pull/32218
### What changes were proposed in this pull request?
This pr improves `JoinSelection` when join condition is not defined. For
example:
```scala
spark.sql("set spark.sql.autoBroadcastJoinThreshold=-1")
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, t2.a from t1 full join t2").explain(true)
```
Before this pr:
```
== Physical Plan ==
AdaptiveSparkPlan isFinalPlan=false
+- BroadcastNestedLoopJoin BuildLeft, FullOuter
:- BroadcastExchange IdentityBroadcastMode, [id=#43]
: +- FileScan parquet default.t1[a#16L]
+- FileScan parquet default.t2[a#18L]
```
After this pr:
```
== Physical Plan ==
CartesianProduct
:- *(1) ColumnarToRow
: +- FileScan parquet default.t1[a#16L]
+- *(2) ColumnarToRow
+- FileScan parquet default.t2[a#18L]
```
### Why are the changes needed?
Avoid OOM and 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]