Repository navigation
fix(syntax): parser gaps batch e (TASK CLONE, CREATE … FROM, quoting, recorded refusals) - #54
Merged
Merged
Conversation
A cloned task has no AS body; the tree keeps the source and the name's quoting. CREATE OR needs REPLACE or ALTER, and a lone word before CLONE is refused.
…LICA A database, schema, table or dynamic table restored from a backup set, a database from a share or as a replica, and a table from an archive are now one node, CreateObject, with the source's names, identifier, alias, condition and properties. A lone word before FROM or AS is refused, not kept raw.
…df_not_measured
Census refuses a compiled model's unresolved __udf("stem") call as fn:<udf>
before naming it, so the driver never saw the Python function and reported
the model as refused. It now reads the compiled source too, resolving each
__udf("stem") to its placeholder, so int_payment_attempts,
int_edge_python_values and int_edge_ticket_tokens are not measured rather
than refused by the converter.
SELECT * RENAME v1 AS "v1 Q", a PIVOT aggregate's alias and UNPIVOT's value and name columns read a quoted name as unquoted, so "v1" and v1 gave one tree (auditor withholds on sf.query.select.select, pivot and unpivot).
# Conflicts: # crates/sqlquack-syntax/src/parser/_helpers/ddl/mod.rs
COMMENT ON TABLE "v1" and COMMENT ON TABLE v1 gave one tree, and COMMENT ON COLUMN "v1 Q" . v1 lost the table's quoting (auditor withhold on sf.ddl.comment.is and column-is). Each part now keeps it; a table of several parts writes its quoted parts with their quotes. Polyglot drops these quotes, so the exact check lists COMMENT ON as kept quoting.
UNDROP STAGE and VARIABLE; CREATE TYPE ... AS <type> as a type alias; Snowflake CREATE TABLE and FUNCTION names refuse reserved words; USING TEMPLATE takes a string or a parenthesized query; a hybrid table needs columns, AS or LIKE; a function body is a string; BEGIN NAME <name> is a named transaction; zero-argument aggregates and FLATTEN() parse as calls with no arguments; PIVOT refuses an aggregate without arguments; FROM ( f() ) needs TABLE( ); AT, BEFORE and CHANGES need their closing parenthesis and CHANGES needs a value; IN is not a function; a type parameter is not a string.
Snowflake reads a CREATE FUNCTION body only as a string or a dollar-quoted block, so polyglot's AS 1 and sqlglot's AS RETURN bodies are now refused under Snowflake (recorded errno 1003 for AS m1).
Contributor
Author
|
Gate (D94):
|
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.
Parser batch gaps-e. Fixes in the Snowflake parser, each checked against receipted Snowflake verdicts.
CreateObjectnode (C confirmed ownership).$$block; BEGIN NAME is a named transaction.FROM ( f() )needs TABLE( ); AT, BEFORE and CHANGES need their closing parenthesis, and CHANGES needs a value; IN isn't a function; a type parameter can't be a string.python_udf_not_measured.[[rejection]]entries for CREATE FUNCTION bodies that aren't strings (polyglotAS 1, sqlglotAS RETURN …).The gate result goes in a comment once it has run on the exact head.