We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CREATE TABLE USING TEMPLATE
Hello!
Code snippet:
from sqlglot import parse_one query = """ CREATE TABLE IF NOT EXISTS MY_DATABASE.MY_SCHEMA.MY_TABLE USING TEMPLATE ( SELECT ARRAY_AGG(OBJECT_CONSTRUCT(*)) FROM TABLE( INFER_SCHEMA( LOCATION => '@MY_DATABASE.MY_SCHEMA.MY_STAGE/my_path' -- noqa: LT05 , FILES => ('MY_FILE.csv') -- noqa: LT05 , FILE_FORMAT => 'MY_DATABASE.MY_SCHEMA.MY_FILE_FORMAT' -- noqa: LT05 ) ) ); """ # parses as an expression fine parsed = parse_one(query, dialect='snowflake') # outputs incorrect sql parsed.sql(dialect='snowflake') ###### Output, which leads to a syntax error in Snowflake """ CREATE TABLE IF NOT EXISTS MY_DATABASE.MY_SCHEMA.MY_TABLE FORMAT=TEMPLATE( SELECT ARRAY_AGG(OBJECT_CONSTRUCT(*)) FROM TABLE(INFER_SCHEMA( LOCATION => '@MY_DATABASE.MY_SCHEMA.MY_STAGE/my_path' /* noqa: LT05 */, FILES => ('MY_FILE.csv') /* noqa: LT05 */, FILE_FORMAT => 'MY_DATABASE.MY_SCHEMA.MY_FILE_FORMAT' /* noqa: LT05 */ )) ) """
Snowflake Docs -> https://docs.snowflake.com/en/sql-reference/sql/create-table#create-table-using-template
The text was updated successfully, but these errors were encountered:
1d6218e
No branches or pull requests
Hello!
Code snippet:
Snowflake Docs -> https://docs.snowflake.com/en/sql-reference/sql/create-table#create-table-using-template
The text was updated successfully, but these errors were encountered: