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

Support unparsing implicit lateral UNNEST plan to SQL text #13824

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Dec 18, 2024

Which issue does this PR close?

Closes #13793

Rationale for this change

Support to unparse the implicit lateral unnest plan. Given a SQL

SELECT * FROM unnest_table u, UNNEST(u.array_col)

It can be planned to the logical plan and unparsed back to the SQL

SELECT * FROM unnest_table AS u CROSS JOIN LATERAL (SELECT UNNEST(u.array_col) AS "UNNEST(outer_ref(u.array_col))")

If with_unnest_as_table_factor is enabled, it will be unparsed to

SELECT * FROM unnest_table AS u CROSS JOIN UNNEST(u.array_col)

What changes are included in this PR?

Are these changes tested?

yes

Are there any user-facing changes?

new unparsing behavior

@github-actions github-actions bot added the sql SQL Planner label Dec 18, 2024
@goldmedal goldmedal marked this pull request as ready for review December 18, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support unparsing implicit lateral UNNEST plan to SQL text
1 participant