Skip to content

fix(syntax): read model, job service, online feature table and semantic view statements as Snowflake does - #210

Merged
kvlonge merged 14 commits into
mainfrom
feat/syntax-pool-17
Nov 12, 2026
Merged

kvlonge merged 14 commits into
mainfrom
feat/syntax-pool-17

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

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 … and DROP MODEL monitor.m1 are read as model statements.
  • An unquoted stage path (EXECUTE JOB SERVICE, ALTER MODEL ADD VERSION, stage-valued properties) is a stage reference with name and path; a quoted value stays a string.
  • CREATE ONLINE FEATURE TABLE no longer requires TARGET_LAG and accepts IF NOT EXISTS.
  • SEMANTIC_VIEW records dimensions_first when DIMENSIONS precedes METRICS or FACTS, since that orders the result columns.
  • New cases: JOIN read-order clauses after ON TRUE, model monitor *_COLUMNS as arrays, one case per option of both model monitor forms, warehouse _x86 constraints, online feature table shapes.
  • Evidence pinned to 3e96beb9; coverage regenerated.

Verification

Against main on evidence 3e96beb9:

  • False accepts / false rejects / other receipts: 766 / 380 / 349, unchanged.
  • Verified forms: 2,418 → 2,422 of 3,351: JOIN with ON, both model monitor forms, semantic view.
  • Satisfied obligations: 82,598 → 82,577. Only withdrawn or renumbered obligations dropped; none still defined lost its case.

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 _x86 constraints and one online feature table shape.

Each fix has a regression test. make check-ci passed.

…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.
@kvlonge
kvlonge added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 1efef11 Nov 12, 2026
13 checks passed
@kvlonge
kvlonge deleted the feat/syntax-pool-17 branch November 12, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant