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