Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

a followup of #26576, which mistakenly removes the UI update of the final plan.

Why are the changes needed?

fix mistake.

Does this PR introduce any user-facing change?

no

How was this patch tested?

existing tests

@cloud-fan
Copy link
Contributor Author

cc @maryannxue @JkSelf

@SparkQA
Copy link

SparkQA commented Dec 20, 2019

Test build #115624 has finished for PR 26968 at commit 566918c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JkSelf
Copy link

JkSelf commented Dec 20, 2019

LGTM. Thanks

@dongjoon-hyun dongjoon-hyun changed the title [SQL][minor] update the final plan in UI for AQE [SPARK-29906][SQL][FOLLOWUP] update the final plan in UI for AQE Dec 21, 2019
@dongjoon-hyun dongjoon-hyun changed the title [SPARK-29906][SQL][FOLLOWUP] update the final plan in UI for AQE [SPARK-29906][SQL][FOLLOWUP] Update the final plan in UI for AQE Dec 21, 2019
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Merged to master.

@manuzhang
Copy link
Member

@cloud-fan Is there any UT to catch such mistake that it won't happen again ?

@cloud-fan
Copy link
Contributor Author

unfortunately we don't have a good test framework for UI. It would be great if we have one.


// Run the final plan when there's no more unfinished stages.
currentPhysicalPlan = applyPhysicalRules(result.newPlan, queryStageOptimizerRules)
executionId.foreach(onUpdatePlan)
Copy link
Member

Choose a reason for hiding this comment

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

Why is the plan sent out before isFinalPlan = true ? Isn't it the final plan ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't matter. onUpdatePlan only look at currentPhysicalPlan, so we must call onUpdatePlan after setting currentPhysicalPlan.

Copy link
Member

Choose a reason for hiding this comment

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

Does it matter for what's displayed on UI or anyone interested in sql update event ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean? Even if you move isFinalPlan = true before this line, nothing gets changed.

Copy link
Member

Choose a reason for hiding this comment

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

The root nodes of Physical Plan in physicalPlanDescriptions are different: AdaptiveSparkPlan(isFinalPlan=true) vs AdaptiveSparkPlan(isFinalPlan=false). So are root nodes of sparkPlan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah good catch! somehow I misread the code and thought it doesn't matter.

For UI it doesn't matter as we will strip the AdaptiveSparkPlanExec, but if there is a spark listener catching this event, it matters.

Can you send a PR to fix it? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Sure. Thanks for your reply.

Copy link
Member

Choose a reason for hiding this comment

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

I've sent #26983. Please review.

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.

5 participants