ygf11 opened a new issue, #4140:
URL: https://github.com/apache/arrow-datafusion/issues/4140
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
Currently some equality joins which contain normal expressions will run as
cross join. We can move these to hash-join to improve performance.
For example:
```
❯ explain select * from test0 as t0 inner join test1 as t1 on t0.c0 + 1 =
t1.c0;
+---------------+-----------------------------------------------------------------------------------------------------------+
| plan_type | plan
|
+---------------+-----------------------------------------------------------------------------------------------------------+
| logical_plan | Projection: t0.c0, t1.c0
|
| | Filter: CAST(t0.c0 AS Int64) + Int64(1) = CAST(t1.c0 AS
Int64) |
| | CrossJoin:
|
| | SubqueryAlias: t0
|
| | TableScan: test0 projection=[c0]
|
| | SubqueryAlias: t1
|
| | TableScan: test1 projection=[c0]
|
| physical_plan | ProjectionExec: expr=[c0@0 as c0, c0@1 as c0]
|
| | CoalesceBatchesExec: target_batch_size=4096
|
| | FilterExec: CAST(c0@0 AS Int64) + 1 = CAST(c0@1 AS
Int64) |
| | CrossJoinExec
|
| | RepartitionExec: partitioning=RoundRobinBatch(32)
|
| | ParquetExec: limit=None,
partitions=[test0.parquet], projection=[c0] |
| | RepartitionExec: partitioning=RoundRobinBatch(32)
|
| | ParquetExec: limit=None,
partitions=[test1.parquet], projection=[c0] |
| |
|
+---------------+-----------------------------------------------------------------------------------------------------------+
2 rows in set. Query took 0.008 seconds.
```
**Describe the solution you'd like**
Move these equality joins from cross join to join in logical and physical
plan.
In addition, it also helps to fix:
* https://github.com/apache/arrow-datafusion/issues/2877
**Describe alternatives you've considered**
**Additional context**
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]