You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EPIC] Support Exprs as equality join predicates (constants) rather than just Columns in physical joins #9056
Is your feature request related to a problem or challenge?
TLDR is that it would be nice to more easily use DataFusion as an execution engine for engines like Spark (e.g. the comet project apache/datafusion-comet#1), where operators directly take general expressions as join keys.
Currently the join keys of join operators like SortMergeJoin are restricted to be Column. But it is commonly we use expressions (e.g., l_col + 1 = r_col + 2) other than simply columns as join keys. From the query plan, DataFusion seems to add additional Project under join operator which projects the expressions into columns. So the above join operators take join keys as columns.
However, in other query engines, e.g., Spark, its query plan doesn't have the additional projection but its join operators directly take general expressions as join keys. (note that by adding additional projection before join in Spark it means more data to be shuffled/sorted which can be bad for performance)
That means if we cannot delegate such join operators to DataFusion physical join operators which require join keys must be columns.
This patch tries to relax this join keys constraint of physical join operators. So we can construct DataFusion physical join operator using general expressions as join keys.
This patch doesn't change how DataFusion plans the join operators. I.e., DataFusion still plans a join operation using non-column join keys into projection + join operator with columns. (We probably can remove this additional projection later if it also adds additional cost to DataFusion. Currently I'm not sure if/how DataFusion plans partitioning for the join operators.)
Describe the solution you'd like
No response
Describe alternatives you've considered
We could potentially still require joins to take only columns, and require other parts of the system to insert ProjectionExecs
Activity
viirya commentedon Jan 29, 2024
I think this target is already achieved in #8991.
viirya commentedon Jan 29, 2024
For that, I replied in #8991 (comment).
alamb commentedon Jan 30, 2024
It appears I may have missed some of #8991 -- there may not be much more left to do in this epic.
alamb commentedon Aug 12, 2025
I think this one is completed and it isn't clear there is any specific work done, so closing it down. Please let me know if I got that wrong