Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-column key for equijoin when eliminating cross join to inner join #4442

Closed
ygf11 opened this issue Nov 30, 2022 · 0 comments · Fixed by #4443
Closed

Add support for non-column key for equijoin when eliminating cross join to inner join #4442

ygf11 opened this issue Nov 30, 2022 · 0 comments · Fixed by #4443
Labels
enhancement New feature or request

Comments

@ygf11
Copy link
Contributor

ygf11 commented Nov 30, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently datafusion support to rewrite cross join to inner join. For example:

select * from test0 as t0 cross join test1 as t1 where t0.a = t1.a;
select * from test0 as t0 cross join test1 as t1 where t0.b = t1.b;
...

But only when the join keys are column, so the following sql will not rewrite to inner join.

select * from test0 as t0 cross join test1 as t1 where t0.a + 1 = t1.a * 2;
select * from test0 as t0 cross join test1 as t1 where t0.a * 2 = t1.a - 1;
...

Describe the solution you'd like
Add support for non-column key for equijoin when eliminating cross join to inner join

Describe alternatives you've considered

Additional context

@ygf11 ygf11 added the enhancement New feature or request label Nov 30, 2022
@ygf11 ygf11 changed the title Add support for non-column key for equijoin in eliminating cross join to inner join Add support for non-column key for equijoin when eliminating cross join to inner join Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant