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

Fix typo in Snowflake dialect #3813

Merged
merged 3 commits into from Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sqlfluff/dialects/dialect_snowflake.py
Expand Up @@ -1932,7 +1932,7 @@ class AccessStatementSegment(BaseSegment):
),
),
Sequence("APPLY", "MASKING", "POLICY"),
Sequence("APPLY", "RAW", "ACCESS", "POLICY"),
Sequence("APPLY", "ROW", "ACCESS", "POLICY"),
tunetheweb marked this conversation as resolved.
Show resolved Hide resolved
Sequence("APPLY", "SESSION", "POLICY"),
Sequence("APPLY", "TAG"),
Sequence("ATTACH", "POLICY"),
Expand Down
16 changes: 16 additions & 0 deletions test/fixtures/dialects/snowflake/snowflake_grant_revoke.sql
Expand Up @@ -79,3 +79,19 @@ revoke usage on schema mydb.shared_schema from share share1;
revoke select on all tables in schema mydb.public from share share1;
revoke usage on schema mydb.public from share share1;
revoke usage on database mydb from share share1;

grant apply masking policy on account to role my_role;
grant apply row access policy on account to role my_role;
grant apply session policy on account to role my_role;
grant apply tag on account to role my_role;
grant attach policy on account to role my_role;
grant execute task on account to role my_role;
grant import share on account to role my_role;
grant manage grants on account to role my_role;
grant monitor execution on account to role my_role;
grant monitor usage on account to role my_role;
grant override share restrictions on account to role my_role;
grant create account on account to role my_role;
grant create share on account to role my_role;
grant create network policy on account to role my_role;
grant create data exchange listing on account to role my_role;
190 changes: 189 additions & 1 deletion test/fixtures/dialects/snowflake/snowflake_grant_revoke.yml
Expand Up @@ -3,7 +3,7 @@
# computed by SQLFluff when running the tests. Please run
# `python test/generate_parse_fixture_yml.py` to generate them after adding or
# altering SQL files.
_hash: 720ff5c9692b2664122dbee7c4bfd1e95e77c4da32e1951c3b60cd829c779749
_hash: ec054d3dbcbf028019afc7e9f1a2fb6d3992fe9de5b15d0d7a78b2cefe802659
file:
- statement:
access_statement:
Expand Down Expand Up @@ -962,3 +962,191 @@ file:
- object_reference:
naked_identifier: share1
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: apply
- keyword: masking
- keyword: policy
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: apply
- keyword: row
- keyword: access
- keyword: policy
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: apply
- keyword: session
- keyword: policy
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: apply
- keyword: tag
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: attach
- keyword: policy
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: execute
- keyword: task
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: import
- keyword: share
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: manage
- keyword: grants
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: monitor
- keyword: execution
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: monitor
- keyword: usage
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: override
- keyword: share
- keyword: restrictions
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: create
- keyword: account
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: create
- keyword: share
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: create
- keyword: network
- keyword: policy
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;
- statement:
access_statement:
- keyword: grant
- keyword: create
- keyword: data
- keyword: exchange
- keyword: listing
- keyword: 'on'
- keyword: account
- keyword: to
- keyword: role
- role_reference:
naked_identifier: my_role
- statement_terminator: ;