Class TemporaryObjectStatements
Answered from the PARSE TREE, by asking the CREATE statement which of its optional tokens
are present. The previous implementation split the SQL on whitespace and looked at the first few
words, which is the thing this project does not do — and it was not merely stylistic: because the
text check ran BEFORE the parser, it "recognised" three spellings the grammar could not actually
parse, so CREATE VOLATILE TABLE inside a procedure produced a confident refusal for a
statement the engine would have rejected as a syntax error anywhere else.
The kind names are Snowflake's own, as they appear in its refusal — TABLE, STAGE,
FILE_FORMAT — with the underscore in FILE_FORMAT and no space.
Only the kinds Frostlake's grammar can express are answered here — which, since the grammar learned the temporary spellings of VIEW and FUNCTION, is every kind Snowflake refuses under owner's rights.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether a parsedCREATEcarries one of the temporary keywords.static StringtemporaryObjectKind(String sqlText) The Snowflake kind name whensqlTextcreates a temporary object, otherwise null.
-
Method Details
-
temporaryObjectKind
The Snowflake kind name whensqlTextcreates a temporary object, otherwise null.Unparseable text answers null: it is not this class's job to report a syntax error, and the engine will raise a better one when it runs the statement.
-
isTemporary
Whether a parsedCREATEcarries one of the temporary keywords.TRANSIENT is deliberately absent: measured live, an owner's rights procedure creates a transient table happily, and a transient object outlives its session. Only TEMPORARY, TEMP and VOLATILE are the temporary spellings — VOLATILE included, live-verified for views, functions and procedures alike, where a leading VOLATILE is the temporary keyword and not the volatility attribute a function may carry after RETURNS.
-