{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13433","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13433/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13433/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13433/events","html_url":"https://github.com/apache/spark/pull/13433","id":157831882,"number":13433,"title":"[SPARK-15692][SQL]Improves the explain output of several physical plans by displaying embedded logical plan in tree style","user":{"login":"clockfly","id":2595532,"avatar_url":"https://avatars.githubusercontent.com/u/2595532?v=3","gravatar_id":"","url":"https://api.github.com/users/clockfly","html_url":"https://github.com/clockfly","followers_url":"https://api.github.com/users/clockfly/followers","following_url":"https://api.github.com/users/clockfly/following{/other_user}","gists_url":"https://api.github.com/users/clockfly/gists{/gist_id}","starred_url":"https://api.github.com/users/clockfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clockfly/subscriptions","organizations_url":"https://api.github.com/users/clockfly/orgs","repos_url":"https://api.github.com/users/clockfly/repos","events_url":"https://api.github.com/users/clockfly/events{/privacy}","received_events_url":"https://api.github.com/users/clockfly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-06-01T06:21:05Z","updated_at":"2016-06-02T00:04:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13433","html_url":"https://github.com/apache/spark/pull/13433","diff_url":"https://github.com/apache/spark/pull/13433.diff","patch_url":"https://github.com/apache/spark/pull/13433.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nImproves the explain output of several physical plans by displaying embedded logical plan in tree style\r\n\r\nSome physical plan contains a embedded logical plan, for example, `cache tableName query` maps to:\r\n\r\n```\r\ncase class CacheTableCommand(\r\n    tableName: String,\r\n    plan: Option[LogicalPlan],\r\n    isLazy: Boolean) \r\n  extends RunnableCommand\r\n``` \r\n\r\nIt is easier to read the explain output if we can display the `plan` in tree style.\r\n\r\n**Before change:**\r\n\r\nEverything is messed in one line.\r\n\r\n```\r\nscala> Seq((1,2)).toDF().createOrReplaceTempView(\"testView\")\r\nscala> spark.sql(\"cache table testView2 select * from testView\").explain()\r\n== Physical Plan ==\r\nExecutedCommand CacheTableCommand testView2, Some('Project [*]\r\n+- 'UnresolvedRelation `testView`, None\r\n), false\r\n```\r\n\r\n**After change:**\r\n\r\n```\r\nscala> spark.sql(\"cache table testView2 select * from testView\").explain()\r\n== Physical Plan ==\r\nExecutedCommand\r\n:  +- CacheTableCommand testView2, false\r\n:     :  +- 'Project [*]\r\n:     :     +- 'UnresolvedRelation `testView`, None\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nManual test.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/223160872","html_url":"https://github.com/apache/spark/pull/13433#issuecomment-223160872","issue_url":"https://api.github.com/repos/apache/spark/issues/13433","id":223160872,"user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars.githubusercontent.com/u/3182036?v=3","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T00:04:29Z","updated_at":"2016-06-02T00:04:29Z","body":"merging to master and 2.0!"}}
{"actor":{"display_login":"cloud-fan"}}