You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by davies <gi...@git.apache.org> on 2016/02/28 08:16:23 UTC

[GitHub] spark pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

GitHub user davies opened a pull request:

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

    [SPARK-13415] [SQL] Visualize subquery in SQL web UI

    ## What changes were proposed in this pull request?
    
    This PR support visualization for subquery in SQL web UI, also improve the explain of subquery, especially when it's used together with whole stage codegen.
    
    For example:
    ```python
    >>> sqlContext.range(100).registerTempTable("range")
    >>> sqlContext.sql("select id / (select sum(id) from range) from range where id > (select id from range limit 1)").explain(True)
    == Parsed Logical Plan ==
    'Project [unresolvedalias(('id / subquery#9), None)]
    :  +- 'SubqueryAlias subquery#9
    :     +- 'Project [unresolvedalias('sum('id), None)]
    :        +- 'UnresolvedRelation `range`, None
    +- 'Filter ('id > subquery#8)
       :  +- 'SubqueryAlias subquery#8
       :     +- 'GlobalLimit 1
       :        +- 'LocalLimit 1
       :           +- 'Project [unresolvedalias('id, None)]
       :              +- 'UnresolvedRelation `range`, None
       +- 'UnresolvedRelation `range`, None
    
    == Analyzed Logical Plan ==
    (id / scalarsubquery()): double
    Project [(cast(id#0L as double) / cast(subquery#9 as double)) AS (id / scalarsubquery())#11]
    :  +- SubqueryAlias subquery#9
    :     +- Aggregate [(sum(id#0L),mode=Complete,isDistinct=false) AS sum(id)#10L]
    :        +- SubqueryAlias range
    :           +- Range 0, 100, 1, 4, [id#0L]
    +- Filter (id#0L > subquery#8)
       :  +- SubqueryAlias subquery#8
       :     +- GlobalLimit 1
       :        +- LocalLimit 1
       :           +- Project [id#0L]
       :              +- SubqueryAlias range
       :                 +- Range 0, 100, 1, 4, [id#0L]
       +- SubqueryAlias range
          +- Range 0, 100, 1, 4, [id#0L]
    
    == Optimized Logical Plan ==
    Project [(cast(id#0L as double) / cast(subquery#9 as double)) AS (id / scalarsubquery())#11]
    :  +- SubqueryAlias subquery#9
    :     +- Aggregate [(sum(id#0L),mode=Complete,isDistinct=false) AS sum(id)#10L]
    :        +- Range 0, 100, 1, 4, [id#0L]
    +- Filter (id#0L > subquery#8)
       :  +- SubqueryAlias subquery#8
       :     +- GlobalLimit 1
       :        +- LocalLimit 1
       :           +- Project [id#0L]
       :              +- Range 0, 100, 1, 4, [id#0L]
       +- Range 0, 100, 1, 4, [id#0L]
    
    == Physical Plan ==
    WholeStageCodegen
    :  +- Project [(cast(id#0L as double) / cast(subquery#9 as double)) AS (id / scalarsubquery())#11]
    :     :  +- Subquery subquery#9
    :     :     +- WholeStageCodegen
    :     :        :  +- TungstenAggregate(key=[], functions=[(sum(id#0L),mode=Final,isDistinct=false)], output=[sum(id)#10L])
    :     :        :     +- INPUT
    :     :        +- Exchange SinglePartition, None
    :     :           +- WholeStageCodegen
    :     :              :  +- TungstenAggregate(key=[], functions=[(sum(id#0L),mode=Partial,isDistinct=false)], output=[sum#14L])
    :     :              :     +- Range 0, 1, 4, 100, [id#0L]
    :     +- Filter (id#0L > subquery#8)
    :        :  +- Subquery subquery#8
    :        :     +- CollectLimit 1
    :        :        +- WholeStageCodegen
    :        :           :  +- Project [id#0L]
    :        :           :     +- Range 0, 1, 4, 100, [id#0L]
    :        +- Range 0, 1, 4, 100, [id#0L]
    ```
    
    The web UI looks like:
    
    ![subquery](https://cloud.githubusercontent.com/assets/40902/13377963/932bcbae-dda7-11e5-82f7-03c9be85d77c.png)
    
    This PR also change the tree structure of WholeStageCodegen to make it consistent than others. Before this change, Both WholeStageCodegen and InputAdapter hold a references to the same plans, those could be updated without notify another, causing problems, this is discovered by #11403 .
    
    ## How was this patch tested?
    
    Existing tests, also manual tests with the example query, check the explain and web UI.
    
    
    
    


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

    $ git pull https://github.com/davies/spark viz_subquery

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

    https://github.com/apache/spark/pull/11417.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 #11417
    
----
commit 24757f1fd0861507e3b773b171620e230ad96755
Author: Davies Liu <da...@databricks.com>
Date:   2016-02-28T07:06:06Z

    Visualize subquery in SQL web UI

----


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190486545
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52208/
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-191059897
  
    **[Test build #2601 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2601/consoleFull)** for PR 11417 at commit [`e69262a`](https://github.com/apache/spark/commit/e69262ae6d4648f4f0314b0c05e898fd239996b2).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189822314
  
    **[Test build #52141 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52141/consoleFull)** for PR 11417 at commit [`bc2c66b`](https://github.com/apache/spark/commit/bc2c66b88070f8a4f743ba4cc18c0a8a59b9cd7b).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-192050139
  
    Thanks. Looks good. I am merging this to master. Let's think about how to improve the name and doc of `treeChildren` and `innerChildren`.


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189834642
  
    **[Test build #52140 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52140/consoleFull)** for PR 11417 at commit [`24757f1`](https://github.com/apache/spark/commit/24757f1fd0861507e3b773b171620e230ad96755).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class InputAdapter(child: SparkPlan) extends UnaryNode with CodegenSupport `
      * `case class WholeStageCodegen(child: CodegenSupport) extends UnaryNode with CodegenSupport `


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190486542
  
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#discussion_r54617585
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala ---
    @@ -230,8 +230,12 @@ abstract class QueryPlan[PlanType <: TreeNode[PlanType]] extends TreeNode[PlanTy
     
       override def simpleString: String = statePrefix + super.simpleString
     
    -  override def treeChildren: Seq[PlanType] = {
    -    val subqueries = expressions.flatMap(_.collect {case e: SubqueryExpression => e})
    -    children ++ subqueries.map(e => e.plan.asInstanceOf[PlanType])
    --- End diff --
    
    See the doc string of treeChildren.


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190984558
  
    **[Test build #52268 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52268/consoleFull)** for PR 11417 at commit [`e69262a`](https://github.com/apache/spark/commit/e69262ae6d4648f4f0314b0c05e898fd239996b2).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190898445
  
    **[Test build #52252 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52252/consoleFull)** for PR 11417 at commit [`3293994`](https://github.com/apache/spark/commit/3293994f421bbab519364314c5ac90e6f2b0e326).
     * 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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190487554
  
    **[Test build #52209 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52209/consoleFull)** for PR 11417 at commit [`cff0871`](https://github.com/apache/spark/commit/cff0871048d3a2d4e420164ef3d6fd9c74f7aa90).
     * 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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189834712
  
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189834722
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52141/
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190481457
  
    **[Test build #52208 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52208/consoleFull)** for PR 11417 at commit [`2a27cd8`](https://github.com/apache/spark/commit/2a27cd80bfe421ffc0dcdb052aaf448ab016614b).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-191018756
  
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#discussion_r54480593
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala ---
    @@ -454,6 +454,11 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product {
       protected def treeChildren: Seq[BaseType] = children
     
       /**
    +   * All the nodes those are parts of this node.
    --- End diff --
    
    All the nodes that are?
    
    How is this different than children?


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189834688
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52140/
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190899243
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52252/
    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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-191090280
  
    **[Test build #2601 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2601/consoleFull)** for PR 11417 at commit [`e69262a`](https://github.com/apache/spark/commit/e69262ae6d4648f4f0314b0c05e898fd239996b2).
     * 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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189912469
  
    **[Test build #2589 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2589/consoleFull)** for PR 11417 at commit [`bc2c66b`](https://github.com/apache/spark/commit/bc2c66b88070f8a4f743ba4cc18c0a8a59b9cd7b).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-191018757
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52268/
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190487647
  
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189926752
  
    **[Test build #2589 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2589/consoleFull)** for PR 11417 at commit [`bc2c66b`](https://github.com/apache/spark/commit/bc2c66b88070f8a4f743ba4cc18c0a8a59b9cd7b).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class WholeStageCodegen(child: SparkPlan) extends UnaryNode with CodegenSupport `


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189834687
  
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#discussion_r54480848
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegen.scala ---
    @@ -362,33 +349,20 @@ case class WholeStageCodegen(plan: CodegenSupport, children: Seq[SparkPlan])
       }
     
       private[sql] override def resetMetrics(): Unit = {
    -    plan.foreach(_.resetMetrics())
    +    child.foreach(_.resetMetrics())
       }
     
    -  override def generateTreeString(
    -      depth: Int,
    -      lastChildren: Seq[Boolean],
    -      builder: StringBuilder): StringBuilder = {
    -    if (depth > 0) {
    -      lastChildren.init.foreach { isLast =>
    -        val prefixFragment = if (isLast) "   " else ":  "
    -        builder.append(prefixFragment)
    -      }
    -
    -      val branch = if (lastChildren.last) "+- " else ":- "
    -      builder.append(branch)
    -    }
    -
    -    builder.append(simpleString)
    -    builder.append("\n")
    +  override def innerChildren: Seq[SparkPlan] = {
    +    child :: Nil
    +  }
     
    -    plan.generateTreeString(depth + 2, lastChildren :+ false :+ true, builder)
    -    if (children.nonEmpty) {
    -      children.init.foreach(_.generateTreeString(depth + 1, lastChildren :+ false, builder))
    -      children.last.generateTreeString(depth + 1, lastChildren :+ true, builder)
    -    }
    +  private def collectDirectInputs(plan: SparkPlan): Seq[SparkPlan] = plan match {
    --- End diff --
    
    what does direct mean? This seems to recurse, making me think not direct.


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189817004
  
    @rxin I think that the schema of the query. The sql string of ScalarSubquery is `scalarsubquery`
    ```
    s"$prettyName($childrenSQL)"
    ```


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190481661
  
    @yhuai @nongli  Had update the doc string of innerChildren and treeChildren to include a example.


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190486478
  
    **[Test build #52208 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52208/consoleFull)** for PR 11417 at commit [`2a27cd8`](https://github.com/apache/spark/commit/2a27cd80bfe421ffc0dcdb052aaf448ab016614b).
     * 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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190487649
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/52209/
    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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#discussion_r54482880
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala ---
    @@ -230,8 +230,12 @@ abstract class QueryPlan[PlanType <: TreeNode[PlanType]] extends TreeNode[PlanTy
     
       override def simpleString: String = statePrefix + super.simpleString
     
    -  override def treeChildren: Seq[PlanType] = {
    -    val subqueries = expressions.flatMap(_.collect {case e: SubqueryExpression => e})
    -    children ++ subqueries.map(e => e.plan.asInstanceOf[PlanType])
    --- End diff --
    
    What is `treeChildren`? Its doc in TreeNode does not really show the difference between it and `children`.


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190483330
  
    **[Test build #52209 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52209/consoleFull)** for PR 11417 at commit [`cff0871`](https://github.com/apache/spark/commit/cff0871048d3a2d4e420164ef3d6fd9c74f7aa90).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189810914
  
    Thanks for adding the screenshot and the explain output!
    
    What's the "(id / scalarsubquery()): double" in Analyzed Logical Plan ?


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

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


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-191018513
  
    **[Test build #52268 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52268/consoleFull)** for PR 11417 at commit [`e69262a`](https://github.com/apache/spark/commit/e69262ae6d4648f4f0314b0c05e898fd239996b2).
     * This patch **fails PySpark 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 pull request: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189822315
  
    **[Test build #52140 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52140/consoleFull)** for PR 11417 at commit [`24757f1`](https://github.com/apache/spark/commit/24757f1fd0861507e3b773b171620e230ad96755).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190855193
  
    **[Test build #52252 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52252/consoleFull)** for PR 11417 at commit [`3293994`](https://github.com/apache/spark/commit/3293994f421bbab519364314c5ac90e6f2b0e326).


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-189834666
  
    **[Test build #52141 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/52141/consoleFull)** for PR 11417 at commit [`bc2c66b`](https://github.com/apache/spark/commit/bc2c66b88070f8a4f743ba4cc18c0a8a59b9cd7b).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class WholeStageCodegen(child: SparkPlan) extends UnaryNode with CodegenSupport `


---
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: [SPARK-13415] [SQL] Visualize subquery in SQL ...

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

    https://github.com/apache/spark/pull/11417#issuecomment-190899239
  
    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