-
Notifications
You must be signed in to change notification settings - Fork 442
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
Conversation
Run Gluten Clickhouse CI |
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.
Just post some comments. Thanks!
object FallbackUtil extends Logging { | ||
|
||
def skip(plan: SparkPlan): Boolean = { | ||
var skip = false |
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: looks unnecessary to use a variable.
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.
done
skip = true | ||
case InputAdapter(_) => | ||
skip = true | ||
case BroadcastExchangeExec(_, _) => |
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.
Should we really need to skip BroadcastExchangeExec
? I think we should do a consistent tackling as ShuffleExchangeExec
.
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.
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?
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.
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 _ => |
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.
ShuffleQueryStageExec
& BroadcastQueryStageExec
should also be skipped, right?
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.
add QueryStageExec
return skip | ||
} | ||
|
||
def isFallback(plan: SparkPlan): Boolean = { |
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: naming as hasFallback
looks better.
gluten-core/src/main/scala/io/glutenproject/utils/FallbackUtil.scala
Outdated
Show resolved
Hide resolved
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.
Just post some comments. Thanks!
df2ac73
to
f02c370
Compare
Run Gluten Clickhouse CI |
@PHILO-HE pls review again |
object FallbackUtil extends Logging with AdaptiveSparkPlanHelper { | ||
|
||
def skip(plan: SparkPlan): Boolean = { | ||
return plan match { |
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.
return
can be removed.
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.
done
true | ||
case _: GlutenRowToColumnarExec => | ||
true | ||
case _: BaseSubqueryExec => |
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.
I note we have a plan named ColumnarSubqueryBroadcastExec
which extending BaseSubqueryExec
. Should we skip this one?
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.
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
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.
f02c370
to
43221a8
Compare
Run Gluten Clickhouse CI |
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.
Approved. Thanks!
What changes were proposed in this pull request?
Support judging whether the execution plan has a fallback
How was this patch tested?
UT