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

Snowflake exclude incorrect parsing #2265

Closed
diogo-fernan opened this issue Sep 20, 2023 · 1 comment · Fixed by #2268
Closed

Snowflake exclude incorrect parsing #2265

diogo-fernan opened this issue Sep 20, 2023 · 1 comment · Fixed by #2268
Assignees

Comments

@diogo-fernan
Copy link

Hi! sqlglot seems to be incorrectly parsing exclude for single columns when no parenthesis are used. Having no parenthesis is valid Snowflake syntax.

Thoughts?

import sqlglot

sql = """
select
    * exclude b  -- incorrectly parsed
    ,b
    ,c
from
    test
;
"""

print(sqlglot.parse_one(sql, read="snowflake"))

sql = """
select
    * exclude(b) -- correctly parsed
    ,b
    ,c
from
    test
;
"""

print(sqlglot.parse_one(sql, read="snowflake"))

# output:
# SELECT * EXCEPT (b /* incorrectly parsed */, b, c) FROM test
# SELECT * EXCEPT (b) /* correctly parsed */, b, c FROM test
@georgesittas
Copy link
Collaborator

Thanks for the report @diogo-fernan, looks like this was an oversight on our end.

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 a pull request may close this issue.

2 participants