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

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

Closed
phillipleblanc opened this issue Nov 18, 2024 · 0 comments · Fixed by #13460
Closed

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

phillipleblanc opened this issue Nov 18, 2024 · 0 comments · Fixed by #13460
Labels
bug Something isn't working

Comments

@phillipleblanc
Copy link
Contributor

Describe the bug

As part of the upgrade to DataFusion v43, we found that the CrossJoin logical plan node was removed in DataFusion (#12985), replacing it with a JOIN with no conditions.

i.e. in DataFusion the following two statements are logically similar:

SELECT * FROM t1 JOIN t2;
SELECT * FROM t1 CROSS JOIN t2;

This is not true for all databases systems, like Postgres/SQL Server - which will interpret the JOIN as an inner join, which then errors out that no conditions were specified:
SELECT * FROM t1 JOIN t2 -- Error: syntax error at or near "JOIN"

For the unparser, we should return an explicit CROSS JOIN when we unparser a JOIN with no conditions.

To Reproduce

Run the unparser for the following query:

SELECT * FROM t1 CROSS JOIN t2 and observe it gets unparsed to SELECT * FROM t1 JOIN t2

Expected behavior

SELECT * FROM t1 CROSS JOIN t2 and SELECT * FROM t1 JOIN t2 are unparsed to SELECT * FROM t1 CROSS JOIN t2

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant