aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorCheng Lian <lian@databricks.com>2016-01-26 20:30:13 -0800
committerYin Huai <yhuai@databricks.com>2016-01-26 20:30:13 -0800
commit58f5d8c1da6feeb598aa5f74ffe1593d4839d11d (patch)
tree635abe8a8aaad075cff00316b0a421c0259f84df /core
parentce38a35b764397fcf561ac81de6da96579f5c13e (diff)
downloadspark-58f5d8c1da6feeb598aa5f74ffe1593d4839d11d.tar.gz
spark-58f5d8c1da6feeb598aa5f74ffe1593d4839d11d.tar.bz2
spark-58f5d8c1da6feeb598aa5f74ffe1593d4839d11d.zip
[SPARK-12728][SQL] Integrates SQL generation with native view
This PR is a follow-up of PR #10541. It integrates the newly introduced SQL generation feature with native view to make native view canonical. In this PR, a new SQL option `spark.sql.nativeView.canonical` is added. When this option and `spark.sql.nativeView` are both `true`, Spark SQL tries to handle `CREATE VIEW` DDL statements using SQL query strings generated from view definition logical plans. If we failed to map the plan to SQL, we fallback to the original native view approach. One important issue this PR fixes is that, now we can use CTE when defining a view. Originally, when native view is turned on, we wrap the view definition text with an extra `SELECT`. However, HiveQL parser doesn't allow CTE appearing as a subquery. Namely, something like this is disallowed: ```sql SELECT n FROM ( WITH w AS (SELECT 1 AS n) SELECT * FROM w ) v ``` This PR fixes this issue because the extra `SELECT` is no longer needed (also, CTE expressions are inlined as subqueries during analysis phase, thus there won't be CTE expressions in the generated SQL query string). Author: Cheng Lian <lian@databricks.com> Author: Yin Huai <yhuai@databricks.com> Closes #10733 from liancheng/spark-12728.integrate-sql-gen-with-native-view.
Diffstat (limited to 'core')
0 files changed, 0 insertions, 0 deletions