You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by Sephiroth-Lin <gi...@git.apache.org> on 2016/06/08 12:27:29 UTC

[GitHub] spark pull request #13561: [SPARK-15824][SQL] Run 'with ... insert ... selec...

GitHub user Sephiroth-Lin opened a pull request:

    https://github.com/apache/spark/pull/13561

    [SPARK-15824][SQL] Run 'with ... insert ... select' failed when use spark thriftserver

    ## What changes were proposed in this pull request?
    
    Dataset.collect will call withNewExecutionId and InsertIntoHadoopFsRelationCommand also will call withNewExecutionId, then for below SQL will cause IllegalArgumentException(spark.sql.execution.id is already set")
    ```sql
    create table src(k int, v int);
    create table src_parquet(k int, v int);
    with v as (select 1, 2) insert into table src_parquet from src;
    ```
    ## How was this patch tested?
    
    Will add UT later


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Sephiroth-Lin/spark SPARK-15824

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13561.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13561
    
----
commit 0f66322b748a95bfa4a122c832680c260f8da843
Author: Sephiroth-Lin <li...@gmail.com>
Date:   2016-06-08T12:19:14Z

    Run 'with ... insert ... select' failed when use spark thriftserver

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60176 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60176/consoleFull)** for PR 13561 at commit [`5091d00`](https://github.com/apache/spark/commit/5091d00113c270da3e8de42feafa02fe89c4a47f).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Just tried it in Databrick CE Spark 1.6.1 and I can reproduce the bug there. The `funny` thing is that the `WITH` clause actually matters; if you remove it the query works fine.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60177/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13561: [SPARK-15824][SQL] Run 'with ... insert ... selec...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13561#discussion_r66896852
  
    --- Diff: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala ---
    @@ -225,7 +225,10 @@ private[hive] class SparkExecuteStatementOperation(
             if (useIncrementalCollect) {
               result.toLocalIterator.asScala
             } else {
    -          result.collect().iterator
    +          sqlContext.sessionState.executePlan(result.logicalPlan).executedPlan match {
    +            case command: ExecutedCommandExec => command.executeCollectPublic().iterator
    --- End diff --
    
    Two things here:
    1. I am pretty sure that not every `RunnableCommand` calls `withNewExecutionId`. See `SetCommand` for instance. Maybe we should modify `InsertIntoHadoopFsRelation` instead.
    2. Technically a `Dataset.collect()` can return something else than a `Row`, but I think this is OK since this is Thrift.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60176 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60176/consoleFull)** for PR 13561 at commit [`5091d00`](https://github.com/apache/spark/commit/5091d00113c270da3e8de42feafa02fe89c4a47f).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13561: [SPARK-15824][SQL] Run 'with ... insert ... selec...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/13561


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60177 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60177/consoleFull)** for PR 13561 at commit [`31212da`](https://github.com/apache/spark/commit/31212da89a7e7acfe7e7ae7f97860f1b45b481b3).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60176/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60172/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    @davies @rxin Can you review the code for this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60445 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60445/consoleFull)** for PR 13561 at commit [`31212da`](https://github.com/apache/spark/commit/31212da89a7e7acfe7e7ae7f97860f1b45b481b3).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13561: [SPARK-15824][SQL] Run 'with ... insert ... selec...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13561#discussion_r66895096
  
    --- Diff: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala ---
    @@ -225,7 +225,10 @@ private[hive] class SparkExecuteStatementOperation(
             if (useIncrementalCollect) {
               result.toLocalIterator.asScala
             } else {
    -          result.collect().iterator
    +          sqlContext.sessionState.executePlan(result.logicalPlan).executedPlan match {
    --- End diff --
    
    use `result.queryExection.executedPlan`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60177 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60177/consoleFull)** for PR 13561 at commit [`31212da`](https://github.com/apache/spark/commit/31212da89a7e7acfe7e7ae7f97860f1b45b481b3).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60172 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60172/consoleFull)** for PR 13561 at commit [`0f66322`](https://github.com/apache/spark/commit/0f66322b748a95bfa4a122c832680c260f8da843).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60445/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60445 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60445/consoleFull)** for PR 13561 at commit [`31212da`](https://github.com/apache/spark/commit/31212da89a7e7acfe7e7ae7f97860f1b45b481b3).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    @Sephiroth-Lin thanks for working on this. What I do not understand is, is that the current code path and the code path in 1.6 are generally the same. Any idea why this is surfacing now?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13561: [SPARK-15824][SQL] Run 'with ... insert ... select' fail...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13561
  
    **[Test build #60172 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60172/consoleFull)** for PR 13561 at commit [`0f66322`](https://github.com/apache/spark/commit/0f66322b748a95bfa4a122c832680c260f8da843).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org