-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-5709] [SQL] Add EXPLAIN support in DataFrame API for debugging purpose #4496
Conversation
Test build #27181 has started for PR 4496 at commit
|
Test build #27181 has finished for PR 4496 at commit
|
Test FAILed. |
Test build #27184 has started for PR 4496 at commit
|
Test build #27184 has finished for PR 4496 at commit
|
Test FAILed. |
@@ -116,6 +116,9 @@ trait DataFrame extends RDDApi[Row] { | |||
/** Prints the schema to the console in a nice tree format. */ | |||
def printSchema(): Unit | |||
|
|||
/** Returns the plan information as string array for debugging purpose. */ | |||
def explain(extended: Boolean): Array[String] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems to me it'd make more sense for explain to just print something to the console by default, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I agree, I will update the code.
Test build #27205 has started for PR 4496 at commit
|
Test build #27205 has finished for PR 4496 at commit
|
Test PASSed. |
@@ -116,6 +116,9 @@ trait DataFrame extends RDDApi[Row] { | |||
/** Prints the schema to the console in a nice tree format. */ | |||
def printSchema(): Unit | |||
|
|||
/** Prints the plan to the console for debugging purpose. */ | |||
def printPlan(extended: Boolean): Unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought explain was a pretty good name actually :)
@marmbrus what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to explain
. Can we have a default that sets extended to false
as well.
013b05a
to
44ddb78
Compare
Test build #27256 has started for PR 4496 at commit
|
mind rebasing quickly? we are going to cut a snapshot release soon. |
@@ -600,6 +600,15 @@ trait Column extends DataFrame { | |||
def desc: Column = exprToColumn(SortOrder(expr, Descending), computable = false) | |||
|
|||
def asc: Column = exprToColumn(SortOrder(expr, Ascending), computable = false) | |||
|
|||
override def explain(extended: Boolean): Unit = { | |||
val e = this.expr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use prettyString
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually pretty string unless extended probably
yes, I am working on it now. |
|
||
override def explain(extended: Boolean): Unit = { | ||
val e = this.expr | ||
if (e == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can never be null
.
44ddb78
to
552aa58
Compare
Test build #27262 has started for PR 4496 at commit
|
Test build #27256 has finished for PR 4496 at commit
|
Test PASSed. |
Test build #27262 has finished for PR 4496 at commit
|
Test PASSed. |
… purpose Author: Cheng Hao <[email protected]> Closes #4496 from chenghao-intel/df_explain and squashes the following commits: 552aa58 [Cheng Hao] Add explain support for DF (cherry picked from commit 45df77b) Signed-off-by: Michael Armbrust <[email protected]>
No description provided.