Repository navigation
fix(syntax): read model, job service, online feature table and semantic view statements as Snowflake does - #210
Merged
Merged
Conversation
…tor column arrays, x86 resource constraints and online feature table shapes These cases are recorded by a later evidence pin. The JOIN form with ON had read-order cases without ON, which Snowflake reads as a table alias; these rows carry ON TRUE. CREATE MODEL MONITOR's *_COLUMNS values are arrays of column-name strings, so their present and operand rows write one- and two-element arrays on a plain base, and the identifier classes, which do not apply to strings, are withdrawn. CREATE OR ALTER WAREHOUSE names each _x86 resource constraint. Six CREATE ONLINE FEATURE TABLE shapes are observed. Two EXECUTE IMMEDIATE FROM stage paths run in a run database.
…alified by monitor ALTER MODEL monitor followed by a dot or an ALTER MODEL action (RENAME TO, SET, UNSET, MODIFY, VERSION, or ADD or DROP VERSION) alters a model, since none of those can follow a model monitor's name. In DROP, a two-word kind whose second word is followed by a dot names an object of the shorter kind in that schema, as it already did at the statement end, so DROP MODEL monitor.m1 drops a model.
The unquoted stage paths of EXECUTE JOB SERVICE, CREATE and ALTER SERVICE, ALTER MODEL ADD VERSION and stage-valued properties were stored as string literals, so a tree could not tell @s1 from '@s1'. They are now stage references with the stage name and the path within it. A quoted value stays a string literal, since it may be any text, such as a comment that starts with @.
…h IF NOT EXISTS Snowflake parses CREATE ONLINE FEATURE TABLE without a TARGET_LAG clause (errno 2029, after parsing) and with IF NOT EXISTS (errno 2003), so only WAREHOUSE stays required and IF NOT EXISTS is read after the kind.
… after ON, model monitor arrays and online feature table shapes The pinned evidence adds 26 receipts and the cases they settle. Every read-order clause after ON is parsed (errno 1868) or a syntax error (1003), every model monitor column array parses, and the two online feature table shapes the parser refused now parse. The receipt-disagreement list is unchanged. Three forms whose fingerprints changed only because stage paths became stage references are re-approved: of their 104 cases, 65 trees are unchanged and 39 differ only by the stage reference. Verified forms stay at 2,418; satisfied obligations move from 82,598 to 82,562 because replaced and withdrawn obligations leave and 18 new ones wait on cases the capture guard holds.
Its read-order cases after ON are parsed (errno 1868) or syntax errors (1003) as Snowflake reports, and its trees record DIRECTED, the read-order word and its alias as written. Verified forms rise to 2,419.
The shared all-options case wrote the column parameters as bare names instead of the documented arrays, so it could not show that the documented options parse together. Each option now has its own case, and the all-options case writes every column parameter as an array with distinct column names.
The version form's shared all-options case also wrote the column parameters as bare names. Each option it served now has its own case, and the all-options case writes all seven column parameters as arrays with distinct column names.
…monitor form and a semantic view with DIMENSIONS before METRICS
…RICS or FACTS Snowflake returns a semantic view's columns in the order its clauses are written, so DIMENSIONS before METRICS puts the dimensions first. The tree dropped that order. It now records dimensions_first, serialized only when true, so trees that write METRICS or FACTS first or DIMENSIONS alone are unchanged.
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 batches showed four Snowflake statements read wrongly: ALTER and DROP of a model named or qualified by
monitor, the EXECUTE JOB SERVICE stage path, CREATE ONLINE FEATURE TABLE without TARGET_LAG or with IF NOT EXISTS, and a SEMANTIC_VIEW that writes DIMENSIONS first. Several forms also waited on new recorded cases.Changes
ALTER MODEL monitor …,ALTER MODEL monitor.m1 …andDROP MODEL monitor.m1are read as model statements.dimensions_firstwhen DIMENSIONS precedes METRICS or FACTS, since that orders the result columns.ON TRUE, model monitor*_COLUMNSas arrays, one case per option of both model monitor forms, warehouse_x86constraints, online feature table shapes.Verification
Against main on evidence 3e96beb9:
Trees: the stage change gives the 28 unquoted EXECUTE JOB SERVICE stage paths a stage reference; quoted stage locations keep main's string. A monitor named rename, modify or version is still a monitor. The semantic view fix changes one of 38 trees.
Still unverified, waiting on cases the guard holds for cost: warehouse
_x86constraints and one online feature table shape.Each fix has a regression test.
make check-cipassed.