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

Parsing issue for Snowflake COPY INTO queries with subqueries #3434

Closed
whummer opened this issue May 8, 2024 · 0 comments · Fixed by #3449
Closed

Parsing issue for Snowflake COPY INTO queries with subqueries #3434

whummer opened this issue May 8, 2024 · 0 comments · Fixed by #3449
Assignees

Comments

@whummer
Copy link

whummer commented May 8, 2024

Hi folks,

looks like we're facing an issue when parsing Snowflake COPY INTO queries with SELECT subqueries:

query = "COPY INTO test (c1) FROM (SELECT $1:c1::string FROM @mystage)"
parse_one(query, read="snowflake")

... which yields the following error:

sqlglot.errors.ParseError: Expected table name but got <Token token_type: TokenType.L_PAREN, text: (, line: 1, col: 32, start: 31, end: 31, comments: []>. Line 1, Col: 32.
COPY INTO t_d56103e1 (c1) FROM (SELECT $1:c1::string FROM @"mystage")

(The query has been validated to run successfully against Snowflake.)

Please let me know if you need any additional information, and whether I can help out with a PR/fix for this. 🙌 Thanks!

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