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

Fix(redshift): unqualify unnest columns #3314

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

georgesittas
Copy link
Collaborator

Before:

>>> from sqlglot import parse_one
>>> from sqlglot.optimizer.qualify import qualify
>>>
>>> print(qualify(parse_one("SELECT c.f::VARCHAR(MAX) AS f, e AS e FROM a.b AS c, c.d AS e", "redshift"), dialect="redshift", infer_schema=False).sql("redshift", pretty=True))
SELECT
  CAST("c"."f" AS VARCHAR(MAX)) AS "f",
  "_q_0"."e" AS "e"
FROM "a"."b" AS "c", "c"."d" AS   "e"

After:

>>> from sqlglot import parse_one
>>> from sqlglot.optimizer.qualify import qualify
>>>
>>> print(qualify(parse_one("SELECT c.f::VARCHAR(MAX) AS f, e AS e FROM a.b AS c, c.d AS e", "redshift"), dialect="redshift", infer_schema=False).sql("redshift", pretty=True))
SELECT
  CAST("c"."f" AS VARCHAR(MAX)) AS "f",
  "e" AS "e"
FROM "a"."b" AS "c", "c"."d" AS "e"

@georgesittas georgesittas merged commit 506760d into main Apr 12, 2024
5 checks passed
@georgesittas georgesittas deleted the jo/unqualify_unnest_columns_redshift branch April 12, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants