GitHub user clockfly opened a pull request:

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

    [SPARK-15692][SQL]Improves the explain output of several physical plans by 
displaying embedded logical plan in tree style

    ## What changes were proposed in this pull request?
    
    Improves the explain output of several physical plans by displaying 
embedded logical plan in tree style
    
    Some physical plan contains a embedded logical plan, for example, `cache 
tableName query` maps to:
    
    ```
    case class CacheTableCommand(
        tableName: String,
        plan: Option[LogicalPlan],
        isLazy: Boolean) 
      extends RunnableCommand
    ``` 
    
    It is easier to read the explain output if we can display the `plan` in 
tree style.
    
    **Before change:**
    
    Everything is messed in one line.
    
    ```
    scala> Seq((1,2)).toDF().createOrReplaceTempView("testView")
    scala> spark.sql("cache table testView2 select * from testView").explain()
    == Physical Plan ==
    ExecutedCommand CacheTableCommand testView2, Some('Project [*]
    +- 'UnresolvedRelation `testView`, None
    ), false
    ```
    
    **After change:**
    
    ```
    scala> spark.sql("cache table testView2 select * from testView").explain()
    == Physical Plan ==
    ExecutedCommand
    :  +- CacheTableCommand testView2, false
    :     :  +- 'Project [*]
    :     :     +- 'UnresolvedRelation `testView`, None
    ```
    
    ## 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_3_2

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

    https://github.com/apache/spark/pull/13433.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 #13433
    
----
commit 8a4423a1bda5258a2af47178c5e7fa90e6239a35
Author: Sean Zhong <seanzh...@databricks.com>
Date:   2016-06-01T02:53:58Z

    some 1

commit f4454a8f52cb775767a7047a6d4282221829ef78
Author: Sean Zhong <seanzh...@databricks.com>
Date:   2016-06-01T05:07:50Z

    some 1

commit 9693e52ad27c6cc68a133398383160365f93ad93
Author: Sean Zhong <seanzh...@databricks.com>
Date:   2016-06-01T05:23:11Z

    some 1

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to