-
Notifications
You must be signed in to change notification settings - Fork 561
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
Parse Snowflake USE ROLE and USE SECONDARY ROLES #1578
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me -- thank you @yoavcloud
FYI @iffyio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @yoavcloud! Just one minor comment on the std assert_eq import
tests/sqlparser_snowflake.rs
Outdated
std::assert_eq!( | ||
snowflake().verified_stmt(&format!("USE ROLE {0}my_role{0}", quote)), | ||
Statement::Use(Use::Role(ObjectName(vec![Ident::with_quote( | ||
quote, | ||
"my_role".to_string(), | ||
)]))) | ||
); | ||
std::assert_eq!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::assert_eq!( | |
snowflake().verified_stmt(&format!("USE ROLE {0}my_role{0}", quote)), | |
Statement::Use(Use::Role(ObjectName(vec![Ident::with_quote( | |
quote, | |
"my_role".to_string(), | |
)]))) | |
); | |
std::assert_eq!( | |
assert_eq!( | |
snowflake().verified_stmt(&format!("USE ROLE {0}my_role{0}", quote)), | |
Statement::Use(Use::Role(ObjectName(vec![Ident::with_quote( | |
quote, | |
"my_role".to_string(), | |
)]))) | |
); | |
assert_eq!( |
if these were autoimported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed across the board
dfa1183
to
61199fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @yoavcloud!
into update * tag 'v0.53.0' of https://github.com/apache/datafusion-sqlparser-rs: (66 commits) Run cargo fmt in derive crate Add Apache license header to spans.rs Update version to 0.53.0 and add release notes (apache#1592) Add support for ODBC functions (apache#1585) Parse `INSERT` with subquery when lacking column names (apache#1586) Support INSERT OVERWRITE INTO syntax (apache#1584) Snowflake ALTER TABLE clustering options (apache#1579) Parse Snowflake USE ROLE and USE SECONDARY ROLES (apache#1578) Add support of the ENUM8|ENUM16 for ClickHouse dialect (apache#1574) Fix displaying WORK or TRANSACTION after BEGIN (apache#1565) Support parsing optional nulls handling for unique constraint (apache#1567) Support BIT column types (apache#1577) Encapsulate CreateFunction (apache#1573) Support Databricks struct literal (apache#1542) Update comments / docs for `Spanned` (apache#1549) Support snowflake double dot notation for object name (apache#1540) `json_object('k' VALUE 'v')` in postgres (apache#1547) Increase version of sqlparser_derive from 0.2.2 to 0.3.0 (apache#1571) Support MySQL size variants for BLOB and TEXT columns (apache#1564) Rename `TokenWithLocation` to `TokenWithSpan`, in backwards compatible way (apache#1562) ...
… into sqlitedollar * 'update' of github.com:AikidoSec/datafusion-sqlparser-rs: (66 commits) Run cargo fmt in derive crate Add Apache license header to spans.rs Update version to 0.53.0 and add release notes (apache#1592) Add support for ODBC functions (apache#1585) Parse `INSERT` with subquery when lacking column names (apache#1586) Support INSERT OVERWRITE INTO syntax (apache#1584) Snowflake ALTER TABLE clustering options (apache#1579) Parse Snowflake USE ROLE and USE SECONDARY ROLES (apache#1578) Add support of the ENUM8|ENUM16 for ClickHouse dialect (apache#1574) Fix displaying WORK or TRANSACTION after BEGIN (apache#1565) Support parsing optional nulls handling for unique constraint (apache#1567) Support BIT column types (apache#1577) Encapsulate CreateFunction (apache#1573) Support Databricks struct literal (apache#1542) Update comments / docs for `Spanned` (apache#1549) Support snowflake double dot notation for object name (apache#1540) `json_object('k' VALUE 'v')` in postgres (apache#1547) Increase version of sqlparser_derive from 0.2.2 to 0.3.0 (apache#1571) Support MySQL size variants for BLOB and TEXT columns (apache#1564) Rename `TokenWithLocation` to `TokenWithSpan`, in backwards compatible way (apache#1562) ...
This PR adds support for Snowflake
USE ROLE <role>
andUSE SECONDARY ROLES
as described here: https://docs.snowflake.com/en/sql-reference/sql/use-secondary-roles