Repository navigation
feat(syntax): give nine Snowflake property-list CREATE kinds structured trees - #208
Merged
Merged
Conversation
…ed trees WAREHOUSE, COMPUTE POOL, EXTERNAL VOLUME, CONTACT, IMAGE, ARTIFACT and GIT REPOSITORY, RESTRICTED SESSION SCOPE and MODEL MONITOR are a name and a property list, so they now parse as property-list objects instead of opaque text. COMPUTE POOL takes FOR APPLICATION <name>. MODEL and VOLUME still start kinds of their own, so CREATE MODEL and CREATE VOLUME are not read as a partial MODEL MONITOR or EXTERNAL VOLUME.
…r tag list, and name RSS Snowflake refuses any property after the tag list of a compute pool or artifact repository, while alerts and groups accept one, so only those two kinds end at their tags. RSS is the short kind of a restricted session scope and now parses like it.
…( x ) after an aliased table, and take job service options before FROM Snowflake reads a bare FIRST or LAST after a joined table as its alias, and refuses FIRST ( x ) or LAST ( x ) with no ON or USING after a table that already has an alias. EXECUTE JOB SERVICE takes its options before FROM as well as after the specification.
…shapes, unrecorded These cases are recorded by a later evidence pin. The derived FIRST and LAST cases of the JOIN syntax form have no ON or USING, so Snowflake reads FIRST ( v1 ) there as a table alias. Replace them with cases that carry USING, and observe the alias reading in four more. Observe five shapes the grammar does not settle: options before FROM SPECIFICATION, a subquery MERGE source, a positional CALL argument, chained joins, and DIMENSIONS before METRICS. Run the seven stage-path cases that need a current database in a run database.
…a run database A session without a current database answers it with errno 90105.
…rder and clause-shape cases
Snowflake reads COPY FILES INTO '@"s1 Q"' and FROM '@"s1 Q"' as stages whose names need quoting, and fails them only on the missing object. The check now takes a string that starts with @ in either position.
The structured trees for nine property-list kinds, the TAG-last refusal, the join alias and job-service fixes and the COPY FILES string stages clear 32 syntax errors the parser accepted and 25 statements it refused; the list only shrinks. Obligations gained: 673. The join form's read-order obligations move to the recorded cases with a read-order clause.
Each item of a parenthesized property value list ended only at a closing parenthesis, so USERS = ( 'u1' , 'u2' ) became a list inside a list. An item now ends at its comma.
… monitor as a model, and refuse a job service option given on both sides of FROM FOR APPLICATION was read as a property of every property-list kind; it is now read only right after a compute pool's name. In CREATE MODEL, a MONITOR followed by a dot, FROM, WITH VERSION or the statement end is the model's name or schema rather than the MODEL MONITOR kind, so CREATE MODEL monitor FROM MODEL m2 and CREATE MODEL monitor.m1 FROM MODEL m2 parse again. An EXECUTE JOB SERVICE option given before FROM is counted when the same option follows the specification.
A keyword used as a bare table alias, such as t2 FIRST, was marked as written with AS, and MERGE never marked an AS it read before a target, subquery or table alias. The flag now says exactly whether AS appears.
… reviewed forms The pinned evidence adds the latest batch of receipts and the cases they settle. Six external-table obligations listed as unobservable because their cases had not been submitted now have receipts, so their entries go. Satisfied obligations rise from 82,587 to 82,598 and parsed cases from 27,072 to 27,082; the receipt-disagreement list is unchanged. Eight forms are approved after a full read of their trees against the documentation, obligations and receipts: join-2, join.join.syntax, MERGE, the JavaScript CALL WITH form, EXECUTE JOB SERVICE, and CREATE CONTACT, GIT REPOSITORY and IMAGE REPOSITORY. Eighteen security-admin forms whose fingerprints changed only through the flat parenthesized list are re-approved: of their 850 cases, 767 trees are unchanged, 82 differ only by the flattened list, and 2 refusals changed their message. Verified forms rise from 2,410 to 2,418.
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
Nine Snowflake CREATE kinds that are a name and a property list were only validated as opaque text, so their forms could not be verified. Recorded batches also showed join, job service and COPY FILES statements read wrongly.
Changes
CREATE MODEL monitorandmonitor.m1still name a model.alias_explicit_asnow means AS was written: false for a baret2 FIRST, true for MERGEUSING ( … ) AS s1.Verification
Against main on evidence 150c169f:
Validated is not parsed: opaque statements satisfy no obligation.
AS flag: converting the 2,539 corpus statements with FROM or USING is byte-identical before and after, FIRST/LAST alias probes give the same DuckDB rows, and MERGE does not convert. join.join.syntax and MERGE are approved on the corrected trees.
Eighteen security-admin forms are re-approved after the list fix: of 850 cases, 767 trees are unchanged, 82 differ only by the flat list, 2 refusals only by message.
Awaiting new recorded cases: join.join (directed FIRST/LAST with ON), both MODEL MONITOR forms (
*_COLUMNSarrays), CREATE OR ALTER WAREHOUSE (_x86constraints).Each fix has a regression test.
make check-cipassed.