-
Notifications
You must be signed in to change notification settings - Fork 182
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: Show user a more intuitive message when queries fall back to Spark #656
Conversation
@parthchandra fyi |
@@ -286,9 +286,10 @@ object CometConf extends ShimCometConf { | |||
conf("spark.comet.explainFallback.enabled") | |||
.doc( | |||
"When this setting is enabled, Comet will provide logging explaining the reason(s) " + | |||
"why a query stage cannot be executed natively.") | |||
"why a query stage cannot be executed natively. Set this to false to " + |
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.
Hmmm, not sure the exact difference from COMET_EXPLAIN_VERBOSE_ENABLED
... @parthchandra
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.
That's a good point. I had tested with this set to true, but for the fallback logging we always want the verbose tree format. I will push a commit to resolve this
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.
Other than the code that I introduced in this PR, which I am now going to remove, the only calls to org.apache.comet.ExtendedExplainInfo#generateExtendedInfo
are from tests, so the COMET_EXPLAIN_VERBOSE_ENABLED
does not actually have any impact on end users. Perhaps it should be marked as an internal config?
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 just remembered that this ExtendedExplainInfo
is implementing a Spark API that the Spark UI can call in Spark 4. Setting COMET_EXPLAIN_VERBOSE_ENABLED will show the tree view there.
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 just remembered that this
ExtendedExplainInfo
is implementing a Spark API that the Spark UI can call in Spark 4. Setting COMET_EXPLAIN_VERBOSE_ENABLED will show the tree view there.
That is correct. We should not change the default (yet). By default the user will see the abbreviated version in the Spark UI. Setting COMET_EXPLAIN_VERBOSE_ENABLED
to true will show the verbose version in the Spark UI.
For our internal logging purposes we can explicitly call ExtendedExplainInfo.generateVerboseExtendedInfo
@@ -286,9 +286,10 @@ object CometConf extends ShimCometConf { | |||
conf("spark.comet.explainFallback.enabled") | |||
.doc( | |||
"When this setting is enabled, Comet will provide logging explaining the reason(s) " + | |||
"why a query stage cannot be executed natively.") | |||
"why a query stage cannot be executed natively. Set this to false to " + |
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 just remembered that this
ExtendedExplainInfo
is implementing a Spark API that the Spark UI can call in Spark 4. Setting COMET_EXPLAIN_VERBOSE_ENABLED will show the tree view there.
That is correct. We should not change the default (yet). By default the user will see the abbreviated version in the Spark UI. Setting COMET_EXPLAIN_VERBOSE_ENABLED
to true will show the verbose version in the Spark UI.
For our internal logging purposes we can explicitly call ExtendedExplainInfo.generateVerboseExtendedInfo
"Comet cannot execute some parts of this plan natively " + | ||
s"(set ${CometConf.COMET_EXPLAIN_FALLBACK_ENABLED.key}=false " + | ||
"to disable this logging):\n" + | ||
s"${info.generateVerboseExtendedInfo(newPlan)}") |
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 generate a very large amount of text if the plan is very large. But I suppose the user can disable the output if they want to.
…ark (apache#656) * update rustfmt to reorder imports * Enable fallback logging by default and use verbose format * update config guide * revert change * revert change * call generateVerboseExtendedInfo instead of generateExtendedInfo * improve log message * improve log message * format
Which issue does this PR close?
N/A
Rationale for this change
Previously we just listed some fallback reasons but without showing which parts of the plan caused this. Now we show a tree view. Here are before and after examples (not for the same plan).
Before
After
What changes are included in this PR?
How are these changes tested?