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-47445][CONNECT][SQL] Add new ExplainMode - SilentMode #45542

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ForVic
Copy link

@ForVic ForVic commented Mar 16, 2024

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

@ForVic ForVic changed the title [DON'T REVIEW NOT COMPLETE] Add new ExplainMode - SilentMode [SPARK-47445] Add new ExplainMode - SilentMode Mar 18, 2024
@ForVic ForVic changed the title [SPARK-47445] Add new ExplainMode - SilentMode [SPARK-47445][CONNECT] Add new ExplainMode - SilentMode Mar 18, 2024
@ForVic ForVic marked this pull request as ready for review March 18, 2024 16:50
Copy link
Contributor

@robreeves robreeves left a 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;
Copy link
Contributor

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.

Suggested change
EXPLAIN_MODE_SILENT = 6;
EXPLAIN_MODE_DISABLED = 6;

Copy link
Author

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.

@ForVic ForVic changed the title [SPARK-47445][CONNECT] Add new ExplainMode - SilentMode [SPARK-47445][CONNECT][SQL] Add new ExplainMode - SilentMode Mar 18, 2024
@ForVic ForVic force-pushed the vsunderl/explain_silent_mode branch from a37d1a6 to bca2424 Compare March 19, 2024 16:58
Copy link

@exia70 exia70 left a 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.


"UNKNOWN_EXPLAIN_MODE": {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants