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

[GLUTEN-1640] Support judging whether the execution plan has a fallback #1641

Merged
merged 1 commit into from
May 25, 2023

Conversation

zheniantoushipashi
Copy link
Contributor

What changes were proposed in this pull request?

Support judging whether the execution plan has a fallback

How was this patch tested?

UT

@github-actions
Copy link

#1640

@github-actions
Copy link

Run Gluten Clickhouse CI

@zzcclp zzcclp requested a review from rui-mo May 15, 2023 09:18
Copy link
Contributor

@PHILO-HE PHILO-HE left a comment

Choose a reason for hiding this comment

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

Just post some comments. Thanks!

object FallbackUtil extends Logging {

def skip(plan: SparkPlan): Boolean = {
var skip = false
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: looks unnecessary to use a variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

skip = true
case InputAdapter(_) =>
skip = true
case BroadcastExchangeExec(_, _) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we really need to skip BroadcastExchangeExec? I think we should do a consistent tackling as ShuffleExchangeExec.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should also skip vanilla spark's transition node: C2R/R2C, assuming transition node is not cared about by us in checking fallback. Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In gluten , the processing of BroadcastExchangeExec and ShuffleExchangeExec is different. I think that BroadcastExchangeExec appears because of BroadcastHashJoinExec, so we ignore it. We only need to pay attention to BroadcastHashJoinExec. Don't worry about this now, i do not skip BroadcastExchangeExec now,

vanilla spark's transition node: C2R/R2C will be cast to GlutenColumnarToRowExecBase/GlutenRowToColumnarExec in gluten that has been ignored

skip = true
case AdaptiveSparkPlanExec(_, _, _, _, _) =>
skip = true
case _ =>
Copy link
Contributor

Choose a reason for hiding this comment

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

ShuffleQueryStageExec & BroadcastQueryStageExec should also be skipped, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add QueryStageExec

return skip
}

def isFallback(plan: SparkPlan): Boolean = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: naming as hasFallback looks better.

Copy link
Contributor

@PHILO-HE PHILO-HE left a comment

Choose a reason for hiding this comment

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

Just post some comments. Thanks!

@github-actions
Copy link

Run Gluten Clickhouse CI

@zheniantoushipashi
Copy link
Contributor Author

@PHILO-HE pls review again

object FallbackUtil extends Logging with AdaptiveSparkPlanHelper {

def skip(plan: SparkPlan): Boolean = {
return plan match {
Copy link
Contributor

Choose a reason for hiding this comment

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

returncan be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

true
case _: GlutenRowToColumnarExec =>
true
case _: BaseSubqueryExec =>
Copy link
Contributor

Choose a reason for hiding this comment

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

I note we have a plan named ColumnarSubqueryBroadcastExec which extending BaseSubqueryExec. Should we skip this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think wo shoud skip ColumnarSubqueryBroadcastExec, We should pay attention to the subclasses of TransformSupport, because these classes will call doValidate to determine whether to fallback, ColumnarSubqueryBroadcastExec is not a subClasses of TransformSupport

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions
Copy link

Run Gluten Clickhouse CI

Copy link
Contributor

@PHILO-HE PHILO-HE left a comment

Choose a reason for hiding this comment

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

Approved. Thanks!

@zzcclp zzcclp merged commit 518a9d7 into apache:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants