Skip to content

feat(syntax): check Snowflake class, DCM project and anonymous procedure grammar - #204

Merged
kvlonge merged 5 commits into
mainfrom
feat/syntax-class-commands
Nov 12, 2026
Merged

kvlonge merged 5 commits into
mainfrom
feat/syntax-class-commands

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Why

Grammar PR C covers the families outside DDL and security/admin. In those families the parser fell back to raw text for Snowflake class instance commands, rejected every EXECUTE DCM PROJECT plan, deploy and preview, and accepted null-input clauses that Snowflake refuses.

Changes

  • CREATE, ALTER and DROP of the seven SNOWFLAKE.<schema>.<class> classes parse against their grammar. This includes the empty schema part that Snowflake accepts.
  • EXECUTE DCM PROJECT PLAN [DELTA], DEPLOY and PREVIEW parse their source and options. Snowflake refuses the page's parenthesised USING values, so they stay rejected. Configuration and deployment names are identifiers, not tables.
  • An anonymous procedure takes a null-input clause only for SQL and JavaScript. It also keeps RETURNS <type> [NOT] NULL in its options instead of dropping it.
  • Reviews approve 23 forms whose obligations were all satisfied.
Snowflake before after
syntax errors accepted 2,356 2,125
parsed cases refused 479 405
other receipts 361 355
verified forms of 3,351 2,388 2,411

This clears 305 disagreements and adds none. The class command forms stay unverified, because Snowflake parses some of their negative neighbours.

Review found these gaps, which are left for a later PR:

  • No cases cover options before the source in EXECUTE JOB SERVICE, a subquery source in MERGE, positional CALL arguments, chained joins, or DIMENSIONS before METRICS.
  • A DELETE USING subquery is a nameless table with a hint.
  • A semantic view's name is a column, and an explicit AS is recorded as absent.
  • FIRST or LAST without ON or USING is read as a read-order clause rather than as an alias.

Verification

  • Parser tests cover each grammar, each refusal from the receipts, and the identifier and nullability trees.
  • syntax-coverage diff against main gains 23 forms and loses none.
  • make check-ci passes.

…rammar

CREATE and ALTER of a class instance, such as SNOWFLAKE.ML.FORECAST,
fell back to raw text, and DROP rejected every class. The seven classes
now parse as their kind, with an empty schema part allowed as Snowflake
does: CREATE takes IF NOT EXISTS, a name, its argument list, then tags
and a comment; ALTER takes RENAME TO or SET and UNSET of tags and
properties; DROP takes IF EXISTS and a name.
EXECUTE DCM PROJECT knew only PURGE and TEST ALL, so every PLAN, DEPLOY
and PREVIEW was rejected. PLAN [ DELTA ] and DEPLOY [ AS <alias> ] now
read a source: FROM DEPLOYMENT and a name, LAST or LATEST, or an
optional USING CONFIGURATION, an optional ENVIRONMENT ( ... ) and FROM a
string path. PLAN takes OUTPUT_PATH. PREVIEW reads a table, its
configuration, an environment, the path and a numeric LIMIT. Snowflake
refuses the page's parenthesised USING values, so they stay rejected.
…ge anonymous procedure

Snowflake parses CALLED ON NULL INPUT, RETURNS NULL ON NULL INPUT and
STRICT on an anonymous SQL or JavaScript procedure, and refuses them
with a syntax error for Python, Java and Scala, though the page
documents them for every language. The parser now takes the clause for
SQL and JavaScript only.
…y in the tree

EXECUTE DCM PROJECT kept its configuration and deployment names as
table references, so a consumer collecting tables saw tables that do
not exist; they are now identifiers. An anonymous procedure read
RETURNS <type> [ NOT ] NULL and dropped the nullability; it is now kept
first in the procedure's options, as CREATE FUNCTION keeps it.
…ixes cleared

Approves reviews of 23 query, DML, function, session, class and utility
forms whose obligations were all satisfied, bound to their fingerprints
and definitions. The disagreements list drops the 305 receipts the
class, DCM project and anonymous procedure grammar now agrees with, and
the baseline records 2,411 verified forms.
@kvlonge
kvlonge added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit c44bdb3 Nov 12, 2026
13 checks passed
@kvlonge
kvlonge deleted the feat/syntax-class-commands branch November 12, 2026 15:00
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