zhztheplayer commented on code in PR #6009:
URL: https://github.com/apache/incubator-gluten/pull/6009#discussion_r1634081190
##########
gluten-core/src/main/scala/org/apache/gluten/extension/columnar/OffloadSingleNode.scala:
##########
@@ -101,23 +101,17 @@ case class OffloadAggregate() extends OffloadSingleNode
with LogLevelUtil {
// Exchange transformation.
case class OffloadExchange() extends OffloadSingleNode with LogLevelUtil {
override def offload(plan: SparkPlan): SparkPlan = plan match {
- case plan if TransformHints.isNotTransformable(plan) =>
- plan
- case plan: ShuffleExchangeExec =>
- logDebug(s"Columnar Processing for ${plan.getClass} is currently
supported.")
- val child = plan.child
- if (
- (child.supportsColumnar || GlutenConfig.getConf.enablePreferColumnar)
&&
- BackendsApiManager.getSettings.supportColumnarShuffleExec()
- ) {
-
BackendsApiManager.getSparkPlanExecApiInstance.genColumnarShuffleExchange(plan,
child)
- } else {
- plan.withNewChildren(Seq(child))
- }
- case plan: BroadcastExchangeExec =>
- val child = plan.child
- logDebug(s"Columnar Processing for ${plan.getClass} is currently
supported.")
- ColumnarBroadcastExchangeExec(plan.mode, child)
+ case p if TransformHints.isNotTransformable(p) =>
+ p
+ case s: ShuffleExchangeExec
+ if (s.child.supportsColumnar ||
GlutenConfig.getConf.enablePreferColumnar) &&
+ BackendsApiManager.getSettings.supportColumnarShuffleExec() =>
+ logDebug(s"Columnar Processing for ${s.getClass} is currently
supported.")
+
BackendsApiManager.getSparkPlanExecApiInstance.genColumnarShuffleExchange(s)
+ case b: BroadcastExchangeExec =>
+ val child = b.child
+ logDebug(s"Columnar Processing for ${b.getClass} is currently
supported.")
+ ColumnarBroadcastExchangeExec(b.mode, child)
Review Comment:
code simplification
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]