aboutsummaryrefslogtreecommitdiff
path: root/sql/hive/src
diff options
context:
space:
mode:
authorHerman van Hovell <hvanhovell@databricks.com>2016-06-15 21:33:26 -0700
committerWenchen Fan <wenchen@databricks.com>2016-06-15 21:33:26 -0700
commitb75f454f946714b93fe561055cd53b0686187d2e (patch)
tree33ff1d7a58a1484e15cdd483e27443fd90410f61 /sql/hive/src
parent5a52ba0f952b21818ed73cb253381f6a3799dc46 (diff)
downloadspark-b75f454f946714b93fe561055cd53b0686187d2e.tar.gz
spark-b75f454f946714b93fe561055cd53b0686187d2e.tar.bz2
spark-b75f454f946714b93fe561055cd53b0686187d2e.zip
[SPARK-15824][SQL] Execute WITH .... INSERT ... statements immediately
## What changes were proposed in this pull request? We currently immediately execute `INSERT` commands when they are issued. This is not the case as soon as we use a `WITH` to define common table expressions, for example: ```sql WITH tbl AS (SELECT * FROM x WHERE id = 10) INSERT INTO y SELECT * FROM tbl ``` This PR fixes this problem. This PR closes https://github.com/apache/spark/pull/13561 (which fixes the a instance of this problem in the ThriftSever). ## How was this patch tested? Added a test to `InsertSuite` Author: Herman van Hovell <hvanhovell@databricks.com> Closes #13678 from hvanhovell/SPARK-15824.
Diffstat (limited to 'sql/hive/src')
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
index d24cde2321..224ff3823b 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
@@ -544,7 +544,7 @@ private[hive] case class InsertIntoHiveTable(
child: LogicalPlan,
overwrite: Boolean,
ifNotExists: Boolean)
- extends LogicalPlan {
+ extends LogicalPlan with Command {
override def children: Seq[LogicalPlan] = child :: Nil
override def output: Seq[Attribute] = Seq.empty