Repository navigation
feat(syntax): check Snowflake class, DCM project and anonymous procedure grammar - #204
Merged
Merged
Conversation
…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.
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
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
SNOWFLAKE.<schema>.<class>classes parse against their grammar. This includes the empty schema part that Snowflake accepts.RETURNS <type> [NOT] NULLin its options instead of dropping it.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:
Verification
syntax-coverage diffagainst main gains 23 forms and loses none.make check-cipasses.