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/02 19:09:05 UTC

[GitHub] spark pull request #13471: [SPARK-15734][SQL] Avoids printing internal row i...

GitHub user clockfly opened a pull request:

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

    [SPARK-15734][SQL] Avoids printing internal row in explain output

    ## What changes were proposed in this pull request?
    
    This PR avoids printing internal rows in explain output for some operators.
    
    **Before change:**
    
    ```
    scala> (1 to 10).toSeq.map(_ => (1,2,3)).toDF().createTempView("df3")
    scala> spark.sql("select * from df3 where 1=2").explain(true)
    ...
    == Analyzed Logical Plan ==
    _1: int, _2: int, _3: int
    Project [_1#37,_2#38,_3#39]
    +- Filter (1 = 2)
       +- SubqueryAlias df3
          +- LocalRelation [_1#37,_2#38,_3#39], [[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3]]
    ...
    == Physical Plan ==
    LocalTableScan [_1#37,_2#38,_3#39]
    ```
    
    **After change:**
    
    ```
    scala> spark.sql("select * from df3 where 1=2").explain(true)
    ...
    == Analyzed Logical Plan ==
    _1: int, _2: int, _3: int
    Project [_1#58,_2#59,_3#60]
    +- Filter (1 = 2)
       +- SubqueryAlias df3
          +- LocalRelation [_1#58,_2#59,_3#60]
    ...
    == Physical Plan ==
    LocalTableScan Empty, [_1#58,_2#59,_3#60]
    ```
    
    ## 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_5

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

    https://github.com/apache/spark/pull/13471.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 #13471
    
----
commit ec97fdeb354cec8adfc3a84b3c1a2216ca1ef785
Author: Sean Zhong <se...@databricks.com>
Date:   2016-06-01T16:02:16Z

    improve the explain output for some primitive types...

commit 47ea0eb779cbccb5f9af1cf68fa109a6aa2c0f1e
Author: Sean Zhong <se...@databricks.com>
Date:   2016-06-02T17:49:33Z

    use stringArgs so that child node can override this.

commit 8ec16840101eea9d63544d8c17594ec0ad2ae893
Author: Sean Zhong <se...@databricks.com>
Date:   2016-06-02T18:07:15Z

    avoid printing internal rows.

----


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    **[Test build #59867 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59867/consoleFull)** for PR 13471 at commit [`2e679f7`](https://github.com/apache/spark/commit/2e679f728d7f680f07d507d17568c7504b03fa43).
     * 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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    This depends on PR https://github.com/apache/spark/pull/13470


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59867/
    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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    cc @cloud-fan


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row i...

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

    https://github.com/apache/spark/pull/13471#discussion_r65613435
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LocalRelation.scala ---
    @@ -57,7 +57,13 @@ case class LocalRelation(output: Seq[Attribute], data: Seq[InternalRow] = Nil)
         LocalRelation(output.map(_.newInstance()), data).asInstanceOf[this.type]
       }
     
    -  override protected def stringArgs = Iterator(output)
    +  override protected def stringArgs: Iterator[Any] = {
    +    if (data.isEmpty) {
    +      Iterator("Empty", output)
    --- End diff --
    
    Good point... How about just "<empty>"? Both "Empty" and "EmptyRelation" look like some class name, while "<empty>" reads more like an annotation. (This is pretty subjective though.)


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    LGTM except for minor naming issue.


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row i...

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

    https://github.com/apache/spark/pull/13471#discussion_r65612208
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/LocalTableScanExec.scala ---
    @@ -48,6 +48,14 @@ private[sql] case class LocalTableScanExec(
         }
       }
     
    +  override protected def stringArgs: Iterator[Any] = {
    +    if (rows.isEmpty) {
    +      Iterator("Empty", output)
    --- End diff --
    
    Just to make sure, do you prefer the following output?
    ```
    LocalTableScan EmptyRelation, [_1#58,_2#59,_3#60]
    ```
    
    Instead of 
    ```
    LocalTableScan Empty, [_1#58,_2#59,_3#60]
    ```



---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    Merging to master and branch-2.0.


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row i...

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

    https://github.com/apache/spark/pull/13471#discussion_r65612007
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LocalRelation.scala ---
    @@ -57,7 +57,13 @@ case class LocalRelation(output: Seq[Attribute], data: Seq[InternalRow] = Nil)
         LocalRelation(output.map(_.newInstance()), data).asInstanceOf[this.type]
       }
     
    -  override protected def stringArgs = Iterator(output)
    +  override protected def stringArgs: Iterator[Any] = {
    +    if (data.isEmpty) {
    +      Iterator("Empty", output)
    --- End diff --
    
    Just to make sure, do you prefer the following output?
    ```
    LocalTableScan EmptyRelation, [_1#58,_2#59,_3#60]
    ```
    
    Instead of 
    ```
    LocalTableScan Empty, [_1#58,_2#59,_3#60]
    ```



---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    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 #13471: [SPARK-15734][SQL] Avoids printing internal row i...

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

    https://github.com/apache/spark/pull/13471#discussion_r65609750
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/LocalTableScanExec.scala ---
    @@ -48,6 +48,14 @@ private[sql] case class LocalTableScanExec(
         }
       }
     
    +  override protected def stringArgs: Iterator[Any] = {
    +    if (rows.isEmpty) {
    +      Iterator("Empty", output)
    --- End diff --
    
    Same as above.


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row i...

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

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


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row i...

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

    https://github.com/apache/spark/pull/13471#discussion_r65609589
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LocalRelation.scala ---
    @@ -57,7 +57,13 @@ case class LocalRelation(output: Seq[Attribute], data: Seq[InternalRow] = Nil)
         LocalRelation(output.map(_.newInstance()), data).asInstanceOf[this.type]
       }
     
    -  override protected def stringArgs = Iterator(output)
    +  override protected def stringArgs: Iterator[Any] = {
    +    if (data.isEmpty) {
    +      Iterator("Empty", output)
    --- End diff --
    
    Maybe "EmptyRelation"?


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59874/
    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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    **[Test build #59867 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59867/consoleFull)** for PR 13471 at commit [`2e679f7`](https://github.com/apache/spark/commit/2e679f728d7f680f07d507d17568c7504b03fa43).


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    **[Test build #59874 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59874/consoleFull)** for PR 13471 at commit [`f94b909`](https://github.com/apache/spark/commit/f94b90989efd83b2b4ff11060d0fee73c3cc0a8c).
     * 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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    LGTM


---
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 #13471: [SPARK-15734][SQL] Avoids printing internal row in expla...

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

    https://github.com/apache/spark/pull/13471
  
    **[Test build #59874 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59874/consoleFull)** for PR 13471 at commit [`f94b909`](https://github.com/apache/spark/commit/f94b90989efd83b2b4ff11060d0fee73c3cc0a8c).


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