Expand description
Spark SQL extensions: LATERAL VIEW, TABLESAMPLE, TRANSFORM, DESCRIBE EXTENDED, etc. Spark SQL feature extensions — pre-processors for SQL constructs that DataFusion doesn’t parse natively.
Supported Spark SQL features:
- LATERAL VIEW:
SELECT ... FROM t LATERAL VIEW explode(arr) AS col - LATERAL VIEW OUTER:
SELECT ... FROM t LATERAL VIEW OUTER explode(arr) AS col - TABLESAMPLE:
SELECT ... FROM t TABLESAMPLE (10 PERCENT) - TRANSFORM:
SELECT TRANSFORM(...) FROM t - DESCRIBE TABLE EXTENDED:
DESCRIBE TABLE EXTENDED t - SHOW TABLE PROPERTIES:
SHOW TBLPROPERTIES t
Functions§
- contains_
describe_ extended - Detects
DESCRIBE TABLE EXTENDEDin SQL. - contains_
lateral_ view - Detects
LATERAL VIEWin SQL. - contains_
show_ tblproperties - Detects
SHOW TBLPROPERTIESin SQL. - contains_
tablesample - Detects
TABLESAMPLEin SQL. - contains_
transform - Detects
TRANSFORMin SQL. - preprocess_
spark_ sql - Apply all Spark SQL pre-processing rewrites to a SQL string.
- rewrite_
describe_ extended - Rewrites
DESCRIBE TABLE EXTENDED <table>to standardDESCRIBE TABLE <table>. - rewrite_
lateral_ view - Rewrites Spark-style
LATERAL VIEWto standard SQLCROSS JOIN LATERAL. - rewrite_
show_ tblproperties - Rewrites
SHOW TBLPROPERTIES <table>to a query against the catalog. - rewrite_
tablesample - Rewrites Spark
TABLESAMPLE(n PERCENT)to DataFusion-compatible form. - rewrite_
transform - Rewrites Spark
TRANSFORM(...)to standard SQL.