-
Notifications
You must be signed in to change notification settings - Fork 166
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
feat: Add logging to explain reasons for Comet not being able to run a query stage natively #397
Changes from 13 commits
19472ed
07c7784
7becda1
26cbb1c
4f2c26c
14d95f1
5c21783
eb9c21c
22409f4
8e800ec
b8566fe
bf87ff7
0dee9c7
78043bd
af39640
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -734,6 +734,23 @@ class CometSparkSessionExtensions | |
} else { | ||
var newPlan = transform(plan) | ||
|
||
// if the plan cannot be run fully natively then explain why (when appropriate | ||
// config is enabled) | ||
if (CometConf.COMET_EXPLAIN_FALLBACK_ENABLED.get()) { | ||
new ExtendedExplainInfo().extensionInfo(newPlan) match { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated, but I feel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I had the same thought There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is possible that it has to be a class due to the way this integrates into Spark, but I am not sure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just seeing this. I don't think Spark prevents us from this being an object. I'll take care of this. #452 |
||
case reasons if reasons.size == 1 => | ||
logWarning( | ||
"Comet cannot execute some parts of this plan natively " + | ||
s"because ${reasons.head}") | ||
case reasons if reasons.size > 1 => | ||
logWarning( | ||
"Comet cannot execute some parts of this plan natively" + | ||
s" because:\n\t- ${reasons.mkString("\n\t- ")}") | ||
case _ => | ||
// no reasons recorded | ||
} | ||
} | ||
|
||
// Remove placeholders | ||
newPlan = newPlan.transform { | ||
case CometSinkPlaceHolder(_, _, s) => s | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ class ExtendedExplainInfo extends ExtendedExplainGenerator { | |
} | ||
} | ||
|
||
private def extensionInfo(node: TreeNode[_]): Set[String] = { | ||
def extensionInfo(node: TreeNode[_]): Set[String] = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I made that change. |
||
var info = mutable.Seq[String]() | ||
val sorted = sortup(node) | ||
sorted.foreach { p => | ||
|
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.
Do we really need to make this configurable?
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 think a config should be good. Sometimes it might be verbose.