-
-
Notifications
You must be signed in to change notification settings - Fork 835
feat(snowflake): add support for 'DROP ICEBERG TABLE' statement #6860
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
Conversation
Added a new segment `DropIcebergTableStatementSegment` in the Snowflake dialect to support parsing of `DROP ICEBERG TABLE [IF EXISTS] <table_name>` syntax. Changes made: - Defined `DropIcebergTableStatementSegment` with appropriate `match_grammar` using `Sequence`, `Ref`, and `IfExistsGrammar`. - Registered the new segment via `snowflake_dialect.add(...)`. This change resolves issues with SQLFluff failing to parse valid Snowflake statements involving Iceberg tables, such as: DROP ICEBERG TABLE IF EXISTS SAMPLE_DEV.SAMPLE.CASH; Helps avoid parse errors like: PRS | Found unparsable section: 'DROP ICEBERG TABLE IF EXISTS ...'
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
Coverage Results ✅
|
Head branch was pushed to by a user without write access
Hi @WittierDinosaur can you approve the pr again as some test fails which required rerun now after new commits |
Added a parser test case for the new DROP ICEBERG TABLE syntax in the Snowflake dialect. This file includes example SQL statements to validate that the dialect correctly parses the new segment implemented in `dialect_snowflake.py`. The corresponding YAML file will be generated using `tox -e generate-fixture-yml`.
Somehow you've got rid of the yml. Run |
Generated .yml file from .sql file using python test/generate_parse_fixture_yml.py -d snowflake
No Danny , The .yml file isn't auto generated due to which some test cases failed , so again it requires the approval. |
Added a new segment
DropIcebergTableStatementSegment
in the Snowflake dialect to support parsing ofDROP ICEBERG TABLE [IF EXISTS] <table_name>
syntax.fixes #6859
Changes made:
DropIcebergTableStatementSegment
with appropriatematch_grammar
usingSequence
,Ref
, andIfExistsGrammar
.snowflake_dialect.add(...)
.This change resolves issues with SQLFluff failing to parse valid Snowflake statements involving Iceberg tables, such as:
Helps avoid parse errors like:
PRS | Found unparsable section: 'DROP ICEBERG TABLE IF EXISTS ...'
Brief summary of the change made
Are there any other side effects of this change that we should be aware of?
Pull Request checklist
Please confirm you have completed any of the necessary steps below.
Included test cases to demonstrate any code changes, which may be one or more of the following:
.yml
rule test cases intest/fixtures/rules/std_rule_cases
..sql
/.yml
parser test cases intest/fixtures/dialects
(note YML files can be auto generated withtox -e generate-fixture-yml
).test/fixtures/linter/autofix
.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.