You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spark/Databricks: CACHE TABLE t; is rejected (only EOF ends the optional query) #2801
CACHE TABLE <name> without a query only parses at the end of input. A ; after it is an error:
CACHE TABLE t;
-> sql parser error: Expected: a QUERY statement, found: ; at Line: 1, Column: 14
CACHE TABLE t; SELECT 1
CACHE LAZY TABLE t OPTIONS ('storageLevel' = 'DISK_ONLY'); SELECT 1
-> same error
CACHE TABLE t AS SELECT 1; SELECT 1
-> 2 statements (fine)
parse_cache_table checks peek_token_ref().token == Token::EOF before calling parse_as_query, so ; goes to the query parser. UNCACHE had the same problem (#1244, fixed in #1320).
Activity