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-47445][CONNECT][SQL] Add new ExplainMode - SilentMode #45542
base: master
Are you sure you want to change the base?
Conversation
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.
Overall LGTM pending the test executions to finish. Also add [SQL]
to the title since that is where the main changes were made.
@@ -125,6 +125,9 @@ message AnalyzePlanRequest { | |||
|
|||
// Generates a physical plan outline and also node details. | |||
EXPLAIN_MODE_FORMATTED = 5; | |||
|
|||
// Does not generate any plan when used. | |||
EXPLAIN_MODE_SILENT = 6; |
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.
nit: Disabled feels more intuitive to me than silent for the naming.
EXPLAIN_MODE_SILENT = 6; | |
EXPLAIN_MODE_DISABLED = 6; |
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.
Are you referring to everywhere, or just here? I'm fine with changing it everywhere, but if that's not the suggestion I think we should keep all references to that mode the same.
a37d1a6
to
bca2424
Compare
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.
Overall LGTM.
Could you please review the two files I put below to see if changes are needed.
spark/python/pyspark/sql/connect/dataframe.py
Line 1914 in c32d278
def explain( |
spark/python/pyspark/errors/error_classes.py
Line 1016 in c32d278
"UNKNOWN_EXPLAIN_MODE": { |
What changes were proposed in this pull request?
I've added a new ExplainMode, SilentMode, which allows us to use EXPLAIN or .explainString without any output.
Why are the changes needed?
While investigating unit test duration we found that org.apache.spark.sql.execution.QueryExecution.explainString () takes approximately 14% time. This method generates the string representation of the execution plan. The string is often used for logging purposes. This is also called for each AQE job so it can save prod execution time too. While SPARK-44485 does exist to help optimize the prod execution time, the main purpose of this PR is to save time during unit testing.
Does this PR introduce any user-facing change?
Yes
How was this patch tested?
A couple new unit tests + existing.
Was this patch authored or co-authored using generative AI tooling?
No