Skip to content

[SPARK-29060][SQL] Add tree traversal helper for adaptive spark plans#25764

Closed
maryannxue wants to merge 1 commit intoapache:masterfrom
maryannxue:aqe-utils
Closed

[SPARK-29060][SQL] Add tree traversal helper for adaptive spark plans#25764
maryannxue wants to merge 1 commit intoapache:masterfrom
maryannxue:aqe-utils

Conversation

@maryannxue
Copy link
Contributor

What changes were proposed in this pull request?

This PR adds a utility class AdaptiveSparkPlanHelper which provides methods related to tree traversal of an AdaptiveSparkPlanExec plan. Unlike their counterparts in TreeNode or
QueryPlan, these methods traverse down leaf nodes of adaptive plans, i.e., AdaptiveSparkPlanExec and QueryStageExec.

Why are the changes needed?

This utility class can greatly simplify tree traversal code for adaptive spark plans.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Refined AdaptiveQueryExecSuite with the help of the new utility methods.

@maryannxue
Copy link
Contributor Author

cc @cloud-fan

@SparkQA
Copy link

SparkQA commented Sep 11, 2019

Test build #110484 has finished for PR 25764 at commit 6401d9c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait AdaptiveSparkPlanHelper

* Returns a sequence containing the subqueries in this plan, also including the (nested)
* subquries in its children
*/
def subqueriesAll(p: SparkPlan): Seq[SparkPlan] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: allSubqueries?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, this consistent with QueryPlan.subqueriesAll

@cloud-fan
Copy link
Contributor

LGTM

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in c56a012 Sep 12, 2019
PavithraRamachandran pushed a commit to PavithraRamachandran/spark that referenced this pull request Sep 15, 2019
### What changes were proposed in this pull request?
This PR adds a utility class `AdaptiveSparkPlanHelper` which provides methods related to tree traversal of an `AdaptiveSparkPlanExec` plan. Unlike their counterparts in `TreeNode` or
`QueryPlan`, these methods traverse down leaf nodes of adaptive plans, i.e., `AdaptiveSparkPlanExec` and `QueryStageExec`.

### Why are the changes needed?
This utility class can greatly simplify tree traversal code for adaptive spark plans.

### Does this PR introduce any user-facing change?
No.

### How was this patch tested?
Refined `AdaptiveQueryExecSuite` with the help of the new utility methods.

Closes apache#25764 from maryannxue/aqe-utils.

Authored-by: maryannxue <maryannxue@apache.org>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
j-baker pushed a commit to palantir/spark that referenced this pull request Jan 25, 2020
This PR adds a utility class `AdaptiveSparkPlanHelper` which provides methods related to tree traversal of an `AdaptiveSparkPlanExec` plan. Unlike their counterparts in `TreeNode` or
`QueryPlan`, these methods traverse down leaf nodes of adaptive plans, i.e., `AdaptiveSparkPlanExec` and `QueryStageExec`.

This utility class can greatly simplify tree traversal code for adaptive spark plans.

No.

Refined `AdaptiveQueryExecSuite` with the help of the new utility methods.

Closes apache#25764 from maryannxue/aqe-utils.

Authored-by: maryannxue <maryannxue@apache.org>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants