Sean Zhong created SPARK-15692:
----------------------------------

             Summary: Improves the explain output of several physical plans by 
displaying embedded logical plan in tree style
                 Key: SPARK-15692
                 URL: https://issues.apache.org/jira/browse/SPARK-15692
             Project: Spark
          Issue Type: Bug
          Components: SQL
            Reporter: Sean Zhong
            Priority: Minor


Some physical plan contains a embedded logical plan, for example, {code}cache 
tableName query{code} maps to:

{code}
case class CacheTableCommand(
    tableName: String,
    plan: Option[LogicalPlan],
    isLazy: Boolean) 
  extends RunnableCommand
{code}

It is easier to read the explain output if we can display the `plan` in tree 
style.

Before change:

{code}
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
{code}

After change:

{code}
scala> spark.sql("cache table testView2 select * from testView").explain()
== Physical Plan ==
ExecutedCommand
:  +- CacheTableCommand testView2, false
:     :  +- 'Project [*]
:     :     +- 'UnresolvedRelation `testView`, None
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to