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
Commit c98241e
Browse filesBrowse the repository at this point in the historyBrowse files
Spark: TABLE t, VALUES ... AS t(a, b), DESC TABLE t (#13 onto the v0.63.0 branch) (#14)
* Spark: TABLE t as a statement, VALUES ... AS t(a, b) as a query body (#13)
* Spark: TABLE t as a statement, VALUES ... AS t(a, b) as a query body
Two dialect hooks, on for Spark, Databricks and Hive. supports_table_statement
lets a statement start with TABLE, which parse_query already reads as
SetExpr::Table. supports_values_alias reads a table alias with a column
list after a VALUES body and rewrites the body as SELECT * FROM (VALUES
...) AS t(a, b), since a bare SetExpr::Values has nowhere to carry the
alias; a reserved word after VALUES (UNION, ORDER, LIMIT) is not an alias.
* parse_as_table: take a second name part only after a period
It read three tokens unconditionally, so TABLE t ORDER BY a swallowed
ORDER BY and then failed on what followed; the statement form is the
first place a clause can follow the name.
* Spark: read TABLE t as SELECT * FROM t in every query-body position
The string-only SetExpr::Table drops identifier quoting and leaves
consumers to special-case it at the top level. Under
supports_table_statement, build a SELECT * over the parsed ObjectName
instead, so TABLE works on set-operation sides, in CTEs, INSERT and
CTAS, and keeps its quote style.
* Spark: DESC TABLE t describes the table, not the query TABLE t
With TABLE able to start a query, DESCRIBE TABLE t parsed as a describe
of that query, and DESCRIBE TABLE EXTENDED t took EXTENDED for the table
name. For DESC/DESCRIBE under supports_table_statement, a TABLE followed
by a name now goes straight to the describe-table form, which accepts
EXTENDED/FORMATTED after TABLE as Spark writes it and prints TABLE
first. DESCRIBE table (a table named table) and EXPLAIN are unchanged.
* Spark: read a VALUES alias on each side of a set operation
The alias was read after the whole query body, by which point a set
operator had been consumed, so VALUES ... AS t(a) UNION ... failed.
Read it where the VALUES operand is parsed, the way TABLE is.
0 commit comments