Repository navigation
fix(syntax): Snowflake ALTER, DROP, COMMENT ON and class method gaps - #51
Merged
Merged
Conversation
- ALTER SEQUENCE RENAME TO and UNSET COMMENT; ALTER VIEW RENAME TO. - ALTER ICEBERG TABLE version tags (CREATE [OR REPLACE], REPLACE, ALTER, DROP), REPLACE PARTITION BY ... WITH, UPGRADE TO ICEBERG VERSION and OPTIMIZE ( REMOVE_POSITION_DELETES ), which plain ALTER TABLE refuses. - ALTER TABLE ADD STORAGE LIFECYCLE POLICY ... ON ( cols ) and DROP STORAGE LIFECYCLE POLICY; RENAME needs TO, and RENAME TO / SWAP WITH refuse an unquoted reserved word, as does the table or view name. - ALTER EXTERNAL TABLE ADD/REMOVE FILES take a non-empty string list; ALTER SHARE UNSET COMMENT is typed; ALTER USER GROUP is refused. - DROP of 35 security object kinds is typed instead of a command fallback; DROP DATABASE keeps CASCADE/RESTRICT; DROP FUNCTION refuses an empty or string TABLE ( ) argument. - COMMENT ON refuses reserved name parts and a non-string value. - CALL <instance>!<method>( ... ) is a typed call with the method as its member, and refuses a missing instance, method or parenthesis.
sqlglot's Snowflake identity fixture writes COMMENT ON ... IS N'...'; the string check refused it, failing the polyglot exact-match run.
…aps-e # Conflicts: # crates/sqlquack-syntax/src/parser/_helpers/ddl/mod.rs
Contributor
Author
|
Gate (D94): Coverage diff against main b323a31 (catalogue f61d213, evidence b22649e, checker built from each tree): forms completed +132 −0, obligations satisfied +1480 −0 (classes +79, ddl +20, security_admin +33). Hygiene: author/committer |
kvlonge
added a commit
that referenced
this pull request
Nov 5, 2026
Basis: main 6a89ed2 (PR #51), catalogue f61d213, evidence b22649e, parser tree c17d619. - 120 forms approved (classes 73, security_admin 33, ddl 14): class instance method calls, DROP of security object kinds, ALTER table, Iceberg, external table and share actions. - Not approved: 11 catalogue findings (budget shared-resource subquery instances, remove-tag/remove-resource-tag and set-email-notifications string operands, forecast series_colname, alter-external-table set, Iceberg upgrade version, replace partition expression, create version_tag interaction, comment.is object type) and 1 parser withhold (COMMENT ON quoting). Checker at 6a89ed2: valid, 3476 forms, 0 problems; 1695 of 3348 verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Snowflake parser gaps found by the syntax coverage checker: ALTER actions of tables, Iceberg tables, sequences, views, external tables and shares; DROP of security object kinds; COMMENT ON; and class instance method calls (
CALL budget!GET_CONFIG()).Changes
AS OF { VERSION | TIMESTAMP } n [ RETAIN n { DAYS | HOURS | MINUTES } ], REPLACE PARTITION BY ( e ) WITH ( e ), UPGRADE TO ICEBERG VERSION n, and OPTIMIZE ( REMOVE_POSITION_DELETES ). Plain ALTER TABLE refuses OPTIMIZE.TABLE ( )argument.<instance>!<method>( … )is a typedCallwith the method as itsmember. It refuses a missing instance, method or parenthesis, and an unquoted reserved instance name. Other CALL forms are unchanged.Not in this PR: B's #49 (DESC/SHOW, CREATE … FROM BACKUP/SHARE/REPLICA/ARCHIVE, CREATE TASK CLONE, TRUNCATE ERROR_TABLE,
parse_object_nameandparse_account_names). This branch only calls those functions. The ALTER TABLE column-action forms are also left out.Coverage diff
Catalogue 1a57a55, evidence cfc73a0, checker built from each tree:
Tests
crates/sqlquack-syntax/tests/parser/test_snowflake_alter_gaps.rscovers acceptance and refusal for each action, with receipt-backed cases where they exist, plus tree shape (kind, action, operands, call member).Gate:
make check-merge RECORDER=0is running on head ea6266e (main 5cfdde2 merged in; main has no changes undercrates/sqlquack-syntax*since 2f0c38a, so the coverage diff above holds). The result will be posted here.