Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-14350][SQL] EXPLAIN output should be in a single cell #12137

Closed
wants to merge 1 commit into from
Closed

[SPARK-14350][SQL] EXPLAIN output should be in a single cell #12137

wants to merge 1 commit into from

Conversation

dongjoon-hyun
Copy link
Member

What changes were proposed in this pull request?

EXPLAIN output should be in a single cell.

Before

scala> sql("explain select 1").collect()
res0: Array[org.apache.spark.sql.Row] = Array([== Physical Plan ==], [WholeStageCodegen], [:  +- Project [1 AS 1#1]], [:     +- INPUT], [+- Scan OneRowRelation[]])

After

scala> sql("explain select 1").collect()
res1: Array[org.apache.spark.sql.Row] =
Array([== Physical Plan ==
WholeStageCodegen
:  +- Project [1 AS 1#4]
:     +- INPUT
+- Scan OneRowRelation[]])

Or,

scala> sql("explain select 1").head
res1: org.apache.spark.sql.Row =
[== Physical Plan ==
WholeStageCodegen
:  +- Project [1 AS 1#5]
:     +- INPUT
+- Scan OneRowRelation[]]

Please note that Spark-shell(Scala-shell) trims long string output. So, you may need to use println to get full strings.

scala> println(sql("explain codegen select 'a' as a group by 1").head)
[Found 2 WholeStageCodegen subtrees.
== Subtree 1 / 2 ==
WholeStageCodegen
...
/* 059 */   }
/* 060 */ }

]

How was this patch tested?

Pass the Jenkins tests. (Testcases are updated.)

@hvanhovell
Copy link
Contributor

LGTM

@dongjoon-hyun
Copy link
Member Author

Thank you for fast review, @hvanhovell !

@SparkQA
Copy link

SparkQA commented Apr 3, 2016

Test build #54802 has finished for PR 12137 at commit a1a9177.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@hvanhovell
Copy link
Contributor

Merging to master. Thanks!

@asfgit asfgit closed this in 1f0c5dc Apr 3, 2016
@dongjoon-hyun
Copy link
Member Author

Oh, thank you! @hvanhovell . :)

@dongjoon-hyun dongjoon-hyun deleted the SPARK-14350 branch May 12, 2016 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants