Repository navigation
fix(snowflake): finish the tree fidelity train with receipt-backed refusals and reviews - #244
Merged
Merged
Conversation
A call records on `from_separator` that FROM, not a comma, separates its first two arguments, so DATE_PART ( DAY FROM d ) and DATE_PART ( DAY , d ) no longer give the same tree. Every other constructor sets it false. The converter's DATE_PART rule reads both spellings the same way, and a test runs both on DuckDB to show the translation is unchanged.
… functions A TABLE ( <type> , ... ) argument in a function signature is now a `table` data type with its column types, in DROP FUNCTION, DESC FUNCTION and ALTER FUNCTION, instead of a type-name string, a raw parameter string or a call named TABLE; DESCRIBE keeps its argument types as data types. A data metric function's TABLE ( <table> ( <column> , ... ) ) argument is a `referenced_table` with the table, its quoting and its columns. The column types sit in their own struct so the data type's traversal frame stays within the 512-level nesting guard on a 2 MB thread.
The reference parser consumed NOT while looking for NOT DEFERRABLE, so REFERENCES v1 NOT ENFORCED read as ENFORCED. It now takes NOT only together with DEFERRABLE.
…s and keep inline ones ENABLE, DISABLE, ENABLE VALIDATE and ENABLE NOVALIDATE become enabled and validated fields on constraint modifiers instead of raw words in properties. An inline column constraint now carries the same typed modifiers as an out-of-line one, so ENFORCED, NOT ENFORCED, DEFERRABLE, INITIALLY, RELY and NORELY after an inline UNIQUE, PRIMARY KEY or REFERENCES are kept and typed. A COMMENT after an inline constraint stays the column's comment.
…nd DYNAMIC tables The checked table grammar kept each out-of-line constraint as a property whose value mixed its columns with raw modifier words such as RELY and COMMENT 'm'. The constraints are now typed table constraints in a new constraints list on the created object, with the same modifier fields as CREATE TABLE and ALTER TABLE ADD. A DEFINE's reference without FOREIGN KEY records that the keywords were omitted.
…gs of columns AUTOINCREMENT and IDENTITY, a parenthesized start and step and START ... INCREMENT ..., and GENERATED ALWAYS AS and a bare AS each produced the same column tree. Columns now record identity_spelling and identity_start_keyword, and computed columns record generated_always, so each spelling is kept.
CREATE VIEW, CREATE MATERIALIZED VIEW and their columns read the optional WITH before a policy or TAG clause but kept the same tree with or without it. The clause's key now starts with WITH when it was written, as table properties already do.
ALTER SEQUENCE INCREMENT [ BY ] [ = ] <n> now records BY and = in the same spelling fields as CREATE SEQUENCE. In ALTER SEQUENCE SET, the property is INCREMENT BY when BY was written, and a new eq flag on object properties records the optional =.
…ex DDL - ALTER DYNAMIC TABLE column actions keep a FORCE after SET MASKING or PROJECTION POLICY, which had no name or value and was dropped. - DROP ROW ACCESS POLICY <p> , ADD ROW ACCESS POLICY ... records the addition as an ADD ROW ACCESS POLICY property on tables and dynamic tables. - CREATE DYNAMIC ICEBERG TABLE, interactive and event tables keep a WITH before their policies and tags in the property kind. - CREATE OR REPLACE INDEX records or_replace.
…apart EXECUTE DCM PROJECT ... FROM DEPLOYMENT LAST or LATEST is now a keyword value instead of an identifier, so it no longer reads like a deployment named LAST; a quoted name stays an identifier. An IMPORTS alias keeps its AS as a keyed part instead of a bare pair of strings.
SHOW SERVICES kept EXCLUDE JOBS and its OF TYPE list in the statement's kind string. They are now an exclude_jobs flag and a service_types list, and the kind stays SERVICES.
CREATE MODEL ... FROM '<stage>' and ALTER MODEL ... ADD VERSION ... FROM '<stage>' kept the quoted stage as a string literal. They now give the same stage reference, with each quoted name part, as COPY gives for the string.
…tage A bare NOT NULL after an external table column's AS expression is the column's inline constraint, not part of the expression; IS NOT NULL still belongs to the expression. A quoted stage name in LOCATION keeps its quotes.
DYNAMIC_TABLE_REFRESH_BOUNDARY ( dt ) AT ( ... ) parsed the clause and dropped it, since only a table reference has a place for it. A FROM call followed by CHANGES or AT | BEFORE is now a table reference holding the call, like IDENTIFIER( ); a call without a clause stays a call.
A stage reference's PATTERN was kept only when it was a string literal, so PATTERN => name was dropped; it is now the expression as written, like FILE_FORMAT, and the three copies of the option loop share one helper. DIRECTORY ( @stage ) reads its argument as a stage reference rather than a column, and a bare @ names no stage instead of a stage called @.
…on's REFRESH_MODE RECURSIVE and the temporary scope words of CREATE VIEW were kept as identifier properties, so LOCAL TEMP read as one name. RECURSIVE is now a flag on the view and a scope other than TEMPORARY is its temporary spelling, as for tables. A semantic view materialization's REFRESH_MODE reads its documented keywords as keywords rather than object names.
Snowflake reads COPY FILES INTO @s1// FROM ... as a stage path, but the tokenizer took // as a line comment and dropped the path and the FROM source. A // written straight after an @ stage word now continues the stage's path; after whitespace it is still a comment. The COPY grammar check no longer needs its exception for the comment, and the FROM stage tests move to their own file.
The key of CREATE ONLINE FEATURE TABLE was an unlabelled tuple of table references. It is now a PRIMARY KEY part whose columns are identifiers with their quoting; the FROM source stays the second operand.
For ( [ <arg> <type> ] [ , ... ] ), the case for "the list continued at least once" left out the optional first item, so it rendered ( ) and covered no continuation. When an optional item and a bare [ , ... ] fill a parenthesized list, the continued case now writes the item and its repeat, as ( v1 INT , v1 INT ). Other lists build the same cases as before.
…mn tags exactly Snowflake takes an event routing rule's REGION_GROUP only as a string, so valid cases now fill it with 'g1' instead of a bare name. The three hand-written limit rows for tags on one column carried a stray extra tag, so the 19, 20 and 21 tag cases held 20, 21 and 22 tags.
…efused them all together Hand rows kept several options of one form on the single all-options statement Snowflake refused, so no option was ever shown valid on its own. Removing those rows and their suppressions lets the refused statement unpack into one case per option, as it already does for generated cases.
…refuses ALTER USER without it Every recorded RENAME TO, SET or UNSET policy, and UNSET TAG statement without a user name was a syntax error, so their valid operands now sit on a named statement and the nameless one is a rejection.
… leaves out Three CREATE PROCEDURE Syntax blocks carry a deprecation comment. It is prose rather than grammar, so the readings now say the grammar leaves it out on purpose. The grammar and its obligations are unchanged.
… list offset The two case-builder tests now share one parametrised test that looks a case up by its SQL, and the walk compares the item position without a bare number.
…BLE, MODIFY CONSTRAINT columns and a bare UNIQUE Recorded receipts show Snowflake refusing each of these as a syntax error: UNSET <property> = <value>, SHOW PARAMETERS IN TABLE without a table, MODIFY CONSTRAINT <name> ( <columns> ), and an out-of-line UNIQUE without a parenthesised column list, which the parser read as a key on a column named after the next word.
… a comment A // straight after a stage continues its path, but the check walked back to the last whitespace, so in LIST @s1;// note the // after the semicolon was read as code. The walk now stops at the first character a stage path cannot hold.
…awn errno 1003 receipts The pinned evidence adds receipts for the new and changed cases, re-records six cases whose only receipt came from the retired errno 1003 rule, and withdraws those receipts and two orphans under that rule.
…OW DATA PLANE INTEGRATIONS LIKE With the region group now a string, receipts reach the region list and show Snowflake refusing a name, an empty list and a trailing comma there, so REGIONS takes one or more strings. SHOW OPENFLOW DATA PLANE INTEGRATIONS takes LIKE, which Snowflake accepted, and still no other option.
…ndow A semantic view has no named windows, so OVER ( v1 ) inside CREATE or DEFINE SEMANTIC VIEW is refused, matching the recorded errno 1003 receipts. Also applies rustfmt to the earlier refusal changes.
… semantic errors Snowflake reports some checks that run after parsing succeeded with errno 1003: an unknown transaction, an unsupported version, an invalid python_version and an invalid domain. Their messages are matched exactly against the text after the compilation prefix line; every other errno 1003 message, including a positioned syntax error that quotes one of them, stays a syntax error. Also moves the semantic view window note into the doc comment.
…rno 1003 receipts
… that now parse Reading constraint modifiers after a foreign key's REFERENCES also reads PostgreSQL's NOT VALID there, into the typed not_valid modifier.
kvlonge
enabled auto-merge
November 16, 2026 04:55
Contributor
Author
|
PostgreSQL
The four re-recorded corpus verdicts (refused → parsed) are true accepts, and the column-level position PostgreSQL refuses is still refused. |
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
Reviews rejected Snowflake trees that lost written keywords or kept options as text, and cases where an option only appeared in a statement Snowflake refused. The parser accepted statements receipts show Snowflake refusing, and six receipts recorded errno 1003 checks that run after parsing as syntax errors.
Changes
//right after a stage path is part of it; after a space or punctuation it is a comment.Still open: 152 forms stay unverified: 83 rejected at review (mostly options shown only in a refused statement, stage LOCATION as text, semantic view keywords, DESC vs DESCRIBE), 15 listed disagreements, the rest await receipts or are unobservable.
Verification
syntax-coverage diffexits 0 with nothing lost or contradicted.make check-cipasses on the final head.