Repository navigation
fix(syntax): read dynamic table, Postgres instance, event routing, grant and sequence statements as Snowflake does - #216
Merged
Merged
Conversation
…t questions, unrecorded Each row is observed, so Snowflake's verdict decides it: DEFAULT after a procedure argument mode, a mode on a function argument, an unnamed procedure argument, LISTING without EXTERNAL or ORGANIZATION, stage paths as listing and Streamlit locations, option order in CORTEX SEARCH SERVICE, SERVICE, APPLICATION SERVICE and DATA MOVEMENT RULE, alert conditions and actions beyond SELECT, a column constraint in a procedure-scoped table, and empty integration lists.
… statement as semantic Six errnos were refused as having no established phase. Each message shows Snowflake parsed the statement and refused it on a rule about what it says: a required listing property (1480), a missing stage for a listing manifest or a Streamlit source (99133, 92804), an IN or OUT mode on an argument of a UDF whose language takes none (90227), an argument reported by its resolved type because it has no name (90201), and what a streaming alert condition may call (392030). They are now reviewed as semantic.
…nt questions Snowflake refuses DEFAULT after an IN or OUT procedure argument mode, as the parser does. It parses a bare LISTING, an unnamed procedure argument, stage paths as listing and Streamlit locations, SERVICE with every option, a tag list or a quoted specification, and alerts that call a procedure or end in a block, which the parser accepts too. Three receipts contradict the parser and are listed until it changes: a mode on a function argument and a column constraint in a procedure-scoped table, which Snowflake parses, and MAX_ROWS before TYPE in a data movement rule, which it refuses. The bare LISTING rejection that the guard used to hold is recorded, so it is no longer unobservable.
The recorded probes show where the parser differed from Snowflake: - a mode after a function argument's name, as for a procedure argument, parses (Snowflake refuses it only for languages without modes); - a procedure-scoped temporary table column may be NOT NULL or NULL; - a data movement rule's TYPE comes before its MAX_ROWS body; - an ALTER setting may take an empty list, as ALTER APPLICATION SERVICE, ALTER STREAMLIT and ALTER APPLICATION SET APP_SPEC do.
…es cleared Remove the 14 receipt disagreements the parser now agrees with and re-record the baseline for the obligations it gained.
…ds them SUSPEND and RESUME SEARCH OPTIMIZATION take no ON targets, a column action that unsets a tag names COLUMN, SET CONTACT takes no parenthesized list, and SET EXECUTE AS USER accepts USE SECONDARY ROLES ALL, NONE or a role list, which ends the SET list. The dynamic table parser tests move to their own file.
Parse CREATE POSTGRES INSTANCE with its FORK source, AT or BEFORE time travel, properties and tags, and ALTER POSTGRES INSTANCE with RENAME to a name without TO, RESET ACCESS FOR, SUSPEND, RESUME, SET and UNSET, instead of keeping them as opaque text. DROP and DESCRIBE accept INSTANCE without POSTGRES, while CREATE and ALTER still need it.
…e does Accept the single-word CREATE VOLUME, CREATE POLICY, CREATE REPLICATION, IMPORT LISTING and IMPORT ORGANIZATION privileges, ON DATA EXCHANGE, a database role granted to a database, a service role granted to an application or database, SHOW GRANTS OF ROLE <instance>!<role> and SHOW GRANTS TO a bare name. Refuse ON MONITOR, ON POOL and ON PACKAGE, which only end a longer kind, and ON ALL or FUTURE without a plural.
ALTER SEQUENCE takes SET with INCREMENT, ORDER, NOORDER and COMMENT, INCREMENT may take = without SET, and an ALTER SEQUENCE with no action is refused. A signed integer is read with its sign, so START -9223372036854775808 fits.
…nd event routing table questions Each row is observed, so Snowflake's verdict decides it: dynamic table clone options one at a time, SET CONTACT and combinations of SET properties, a column policy UNSET without COLUMN, and each part of an event routing rule. The TARGET_LAG and WAREHOUSE clone row duplicates a documented case and is withdrawn.
…and event routing table questions
…s the probe batch recorded A dynamic table clone copies grants but not tags. In ALTER DYNAMIC TABLE SET, FROZEN WHERE and EXECUTE AS USER are set on their own, and an ALTER of a column without COLUMN unsets no masking policy. An event routing rule's REGION_GROUP is a string; ALTER SET RULE takes the fields without an assigned body and with optional commas, while a parenthesized rule needs its commas.
Snowflake reports some refusals of its parser as errno 921 with a message that starts with parse error, such as an unexpected end of the statement. Such an error is now a syntax error; errno 921 with any other message, or raised while a block runs, stays refused.
…an integer Other dialects have no = after INCREMENT in ALTER SEQUENCE, so only Snowflake takes it. ALTER SEQUENCE ... SET INCREMENT now refuses a non-integer, as the form without SET already does. The importer docs now say that errno 921 under the compilation prefix is refused, and the importer tests cover that case and an upper-case parse error message.
… off inside its region list
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.
Why
Recorded Snowflake verdicts disagreed with the parser on several object statements. Each fix follows a receipt.
Changes
INCREMENT =is Snowflake only, and START takes the smallest 64-bit integer.Verification
make check-cipasses on the final head.