apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.33k stars 1.2k forks source link

Unparse inner join with no conditions as a cross join #13460

Closed phillipleblanc closed 3 days ago

phillipleblanc commented 4 days ago

Which issue does this PR close?

Closes #13459

Rationale for this change

This fixes the unparser to explicitly treat inner JOIN with no conditions as a CROSS JOIN, which works for all database systems. DataFusion treats inner joins with no conditions as a CROSS JOIN - but not all database systems the unparser targets support that.

What changes are included in this PR?

When generating the SQL AST for an Inner join with no conditions, return a CROSS JOIN operator instead.

Are these changes tested?

Yes

Are there any user-facing changes?

No API changes.

goldmedal commented 3 days ago

Thanks @phillipleblanc and @alamb for reviewing