You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by liancheng <gi...@git.apache.org> on 2016/03/12 12:11:30 UTC

[GitHub] spark pull request: [SQL] Bring back stack trace of AnalysisExcept...

GitHub user liancheng opened a pull request:

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

    [SQL] Bring back stack trace of AnalysisException thrown from QueryExecution.assertAnalyzed

    ## What changes were proposed in this pull request?
    
    PR #11443 added an extra `plan: Option[LogicalPlan]` argument to `AnalysisException` and attached partially analyzed plan to thrown `AnalysisException` in `QueryExecution.assertAnalyzed()`.  However, the original stack trace wasn't properly inherited.  This PR fixes this issue by inheriting the stack trace.
    
    ## How was this patch tested?
    
    A test case is added to verify that the first entry of `AnalysisException` stack trace isn't from `QueryExecution`.


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

    $ git pull https://github.com/liancheng/spark analysis-exception-stacktrace

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

    https://github.com/apache/spark/pull/11677.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 #11677
    
----
commit 776d3aa23adcef0eff3a36ebe04f6e4887a7bb28
Author: Cheng Lian <li...@databricks.com>
Date:   2016-03-12T10:47:09Z

    Inherits AnalysisException stack trace in assertAnalyzed

commit 00f299ba0462af9fc9448295c7856e2dc2dbb8b2
Author: Cheng Lian <li...@databricks.com>
Date:   2016-03-12T11:08:31Z

    Test

----


---
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: [SQL] Bring back stack trace of AnalysisExcept...

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

    https://github.com/apache/spark/pull/11677#issuecomment-195717577
  
    **[Test build #52999 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52999/consoleFull)** for PR 11677 at commit [`00f299b`](https://github.com/apache/spark/commit/00f299ba0462af9fc9448295c7856e2dc2dbb8b2).


---
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: [SQL] Bring back stack trace of AnalysisExcept...

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

    https://github.com/apache/spark/pull/11677#issuecomment-195735030
  
    **[Test build #52999 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52999/consoleFull)** for PR 11677 at commit [`00f299b`](https://github.com/apache/spark/commit/00f299ba0462af9fc9448295c7856e2dc2dbb8b2).
     * 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 pull request: [SQL] Bring back stack trace of AnalysisExcept...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on the pull request:

    https://github.com/apache/spark/pull/11677#issuecomment-195718320
  
    Also verified locally in Spark shell.
    
    Before:
    
    ```
    scala> sqlContext range 10 select ('id as 'a, 'id as 'b) groupBy 'b agg 'a
    org.apache.spark.sql.AnalysisException: expression '`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;
      at org.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:36)
      at org.apache.spark.sql.Dataset$.newDataFrame(DataFrame.scala:58)
      at org.apache.spark.sql.GroupedData.toDF(GroupedData.scala:58)
      at org.apache.spark.sql.GroupedData.agg(GroupedData.scala:214)
      ... 49 elided
    ```
    
    After:
    
    ```
    scala> sqlContext range 10 select ('id as 'a, 'id as 'b) groupBy 'b agg 'a
    org.apache.spark.sql.AnalysisException: expression '`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$class.failAnalysis(CheckAnalysis.scala:38)
      at org.apache.spark.sql.catalyst.analysis.Analyzer.failAnalysis(Analyzer.scala:50)
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1.org$apache$spark$sql$catalyst$analysis$CheckAnalysis$class$$anonfun$$checkValidAggregateExpression$1(CheckAnalysis.scala:152)
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$4.apply(CheckAnalysis.scala:180)
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$4.apply(CheckAnalysis.scala:180)
      at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1.apply(CheckAnalysis.scala:180)
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1.apply(CheckAnalysis.scala:50)
      at org.apache.spark.sql.catalyst.trees.TreeNode.foreachUp(TreeNode.scala:119)
      at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$class.checkAnalysis(CheckAnalysis.scala:50)
      at org.apache.spark.sql.catalyst.analysis.Analyzer.checkAnalysis(Analyzer.scala:50)
      at org.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:34)
      at org.apache.spark.sql.Dataset$.newDataFrame(DataFrame.scala:58)
      at org.apache.spark.sql.GroupedData.toDF(GroupedData.scala:58)
      at org.apache.spark.sql.GroupedData.agg(GroupedData.scala:214)
      ... 49 elided
    ```



---
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: [SQL] Bring back stack trace of AnalysisExcept...

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

    https://github.com/apache/spark/pull/11677#issuecomment-195735074
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52999/
    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: [SQL] Bring back stack trace of AnalysisExcept...

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

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


---
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: [SQL] Bring back stack trace of AnalysisExcept...

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

    https://github.com/apache/spark/pull/11677#issuecomment-195735073
  
    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 pull request: [SQL] Bring back stack trace of AnalysisExcept...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on the pull request:

    https://github.com/apache/spark/pull/11677#issuecomment-195717446
  
    Seems that ASF JIRA is down right now, and I couldn't find the JIRA number. Will fill it back once JIRA comes back.


---
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: [SQL] Bring back stack trace of AnalysisExcept...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/11677#issuecomment-195794650
  
    Thanks - I've merged this and added JIRA ticket to the commit message.



---
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