-
- Downloads
[SPARK-13924][SQL] officially support multi-insert
## What changes were proposed in this pull request? There is a feature of hive SQL called multi-insert. For example: ``` FROM src INSERT OVERWRITE TABLE dest1 SELECT key + 1 INSERT OVERWRITE TABLE dest2 SELECT key WHERE key > 2 INSERT OVERWRITE TABLE dest3 SELECT col EXPLODE(arr) exp AS col ... ``` We partially support it currently, with some limitations: 1) WHERE can't reference columns produced by LATERAL VIEW. 2) It's not executed eagerly, i.e. `sql("...multi-insert clause...")` won't take place right away like other commands, e.g. CREATE TABLE. This PR removes these limitations and make us fully support multi-insert. ## How was this patch tested? new tests in `SQLQuerySuite` Author: Wenchen Fan <wenchen@databricks.com> Closes #11754 from cloud-fan/lateral-view.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/CatalystQl.scala 11 additions, 11 deletions...ala/org/apache/spark/sql/catalyst/parser/CatalystQl.scala
- sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala 18 additions, 9 deletionssql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
- sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala 29 additions, 0 deletions...a/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
Loading
Please register or sign in to comment