Skip to content

CopyInto with Named File Format in Snowflake hanging on parse #4882

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

Closed
kharigardner opened this issue Mar 17, 2025 · 0 comments · Fixed by #4885
Closed

CopyInto with Named File Format in Snowflake hanging on parse #4882

kharigardner opened this issue Mar 17, 2025 · 0 comments · Fixed by #4885
Assignees

Comments

@kharigardner
Copy link

Related to:
#3434 & #3604

When a named FILE_FORMAT is provided in the COPY INTO ... query, it seems as if the Parser is hanging infinitely, without raising any error.

Example:

from sqlglot import parse_one

query = """
    COPY INTO MY_DATABASE.MY_SCHEMA.MY_TABLE
    FROM @MY_DATABASE.MY_SCHEMA.MY_STAGE/my_path
    FILE_FORMAT=(FORMAT_NAME = MY_DATABASE.MY_SCHEMA.MY_FILE_FORMAT)
"""
# will remain on this line
parsed = parse_one(query, dialect='snowflake')

If commenting out the file format, the parse result is as expected.

Docs: https://docs.snowflake.com/en/sql-reference/sql/copy-into-table

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