You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by clockfly <gi...@git.apache.org> on 2016/06/06 22:13:42 UTC

[GitHub] spark pull request #13535: [SPARK-15792][SQL] Allows operator to change the ...

GitHub user clockfly opened a pull request:

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

    [SPARK-15792][SQL] Allows operator to change the verbosity in explain output

    ## What changes were proposed in this pull request?
    
    This PR allows customization of verbosity in explain output.
    
    After change, `dataframe.explain()` and `dataframe.explain(true)` has different verbosity output for physical plan.
    
    **For dataframe.explain(extended = false):**
    
    `output=[count(a)#85L]` is **NOT** displayed for physical plan.
    
    ```
    scala> Seq((1,2,3)).toDF("a", "b", "c").createTempView("df2")
    scala> spark.sql("select count(a) from df2").explain()
    == Physical Plan ==
    *HashAggregate(key=[], functions=[count(1)])
    +- Exchange SinglePartition
       +- *HashAggregate(key=[], functions=[partial_count(1)])
          +- LocalTableScan
    ```
    
    **For dataframe.explain(extended = true):**
    
    `output=[count(a)#85L]` is displayed for physical plan.
    
    ```
    scala> spark.sql("select count(a) from df2").explain(true)  // "output=[count(a)#85L]" is added
    ...
    == Physical Plan ==
    *HashAggregate(key=[], functions=[count(1)], output=[count(a)#85L])
    +- Exchange SinglePartition
       +- *HashAggregate(key=[], functions=[partial_count(1)], output=[count#87L])
          +- LocalTableScan
    ```
    
    ## How was this patch tested?
    
    Manual test.


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

    $ git pull https://github.com/clockfly/spark verbose_breakdown_2

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

    https://github.com/apache/spark/pull/13535.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 #13535
    
----
commit 1e1e4418003cc13b0e2a118a315f6aa2422c3f14
Author: Sean Zhong <se...@databricks.com>
Date:   2016-05-27T18:54:36Z

    Improve the aggregate output.

----


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60076/
    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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    LGTM, merging to master and branch-2.0. Thanks!


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60088/
    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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    @liancheng  updated.


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    **[Test build #60088 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60088/consoleFull)** for PR 13535 at commit [`1ed295f`](https://github.com/apache/spark/commit/1ed295f12b3da10c0a2ffed69d19ed1ba2f0e010).


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the ...

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

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


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    **[Test build #60076 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60076/consoleFull)** for PR 13535 at commit [`1e1e441`](https://github.com/apache/spark/commit/1e1e4418003cc13b0e2a118a315f6aa2422c3f14).


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the ...

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

    https://github.com/apache/spark/pull/13535#discussion_r65986824
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala ---
    @@ -201,24 +201,26 @@ class QueryExecution(val sparkSession: SparkSession, val logical: LogicalPlan) {
     
       def simpleString: String = {
         s"""== Physical Plan ==
    -       |${stringOrError(executedPlan)}
    +       |${stringOrError(executedPlan.treeString(verbose = false))}
           """.stripMargin.trim
       }
     
       override def toString: String = {
         def output =
           analyzed.output.map(o => s"${o.name}: ${o.dataType.simpleString}").mkString(", ")
    -    val analyzedPlan =
    -      Seq(stringOrError(output), stringOrError(analyzed)).filter(_.nonEmpty).mkString("\n")
    +    val analyzedPlan = Seq(
    +      stringOrError(output),
    +      stringOrError(analyzed.treeString(verbose = true))
    +    ).filter(_.nonEmpty).mkString("\n")
     
         s"""== Parsed Logical Plan ==
    -       |${stringOrError(logical)}
    +       |${stringOrError(logical.treeString(verbose = true))}
            |== Analyzed Logical Plan ==
    -       |$analyzedPlan
    +       |${analyzedPlan}
    --- End diff --
    
    Please revert this change. The braces are unnecessary.


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    The PR description says the verbosity mark affects output of "physical plan", but actually only aggregate operators are affected. Please correct the PR description and add that explain output with different verbosity for all physical plans will be added in follow-ups.


---
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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    **[Test build #60088 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60088/consoleFull)** for PR 13535 at commit [`1ed295f`](https://github.com/apache/spark/commit/1ed295f12b3da10c0a2ffed69d19ed1ba2f0e010).
     * 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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    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 #13535: [SPARK-15792][SQL] Allows operator to change the ...

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

    https://github.com/apache/spark/pull/13535#discussion_r65987602
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala ---
    @@ -190,6 +190,9 @@ abstract class Expression extends TreeNode[Expression] {
         case single => single :: Nil
       }
     
    +  // Marks this as final, verboseString of Expression is NEVER called.
    +  final override def verboseString: String = simpleString
    +
    --- End diff --
    
    > Marks this as final, `Expression.verboseString` should never be called, and thus shouldn't be overriden by concrete 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 #13535: [SPARK-15792][SQL] Allows operator to change the verbosi...

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

    https://github.com/apache/spark/pull/13535
  
    **[Test build #60076 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60076/consoleFull)** for PR 13535 at commit [`1e1e441`](https://github.com/apache/spark/commit/1e1e4418003cc13b0e2a118a315f6aa2422c3f14).
     * 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