wForget commented on code in PR #11162:
URL:
https://github.com/apache/incubator-gluten/pull/11162#discussion_r2559114949
##########
gluten-substrait/src/main/scala/org/apache/gluten/execution/WholeStageTransformer.scala:
##########
@@ -271,30 +271,19 @@ case class WholeStageTransformer(child: SparkPlan,
materializeInput: Boolean = f
/** Find all [[LeafTransformSupport]] in one WholeStageTransformer */
private def findAllLeafTransformers(): Seq[LeafTransformSupport] = {
- val allLeafTransformers = new mutable.ListBuffer[LeafTransformSupport]()
-
- def transformChildren(plan: SparkPlan): Unit = {
- if (plan != null && plan.isInstanceOf[TransformSupport]) {
- plan match {
- case transformer: LeafTransformSupport =>
- allLeafTransformers.append(transformer)
- case _ =>
- }
-
- // according to the substrait plan order
- // SHJ may include two leaves in a whole stage.
- plan match {
- case shj: HashJoinLikeExecTransformer =>
- transformChildren(shj.streamedPlan)
- transformChildren(shj.buildPlan)
- case t: TransformSupport =>
- t.children.foreach(transformChildren(_))
- }
- }
+
+ def collectLeafTransformers(plan: SparkPlan): Seq[LeafTransformSupport] =
plan match {
+ case transformer: LeafTransformSupport =>
+ Seq(transformer)
+ case shj: HashJoinLikeExecTransformer =>
Review Comment:
nit: Is this case branch also unnecessary?
--
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]