wecharyu commented on code in PR #12703:
URL: https://github.com/apache/gluten/pull/12703#discussion_r3854590821


##########
gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenExplainUtils.scala:
##########
@@ -45,6 +45,36 @@ import scala.collection.mutable.{ArrayBuffer, BitSet}
 object GlutenExplainUtils extends AdaptiveSparkPlanHelper {
   type FallbackInfo = (Int, Map[String, String])
 
+  /**
+   * Returns whether a plan should be ignored when collecting fallback 
statistics.
+   *
+   * Such plans are structural wrappers rather than execution operators: they 
are neither fallback
+   * Spark operators nor native Gluten operators.
+   */
+  def isFallbackInsensitivePlan(plan: SparkPlan): Boolean = plan match {
+    case _: ExecutedCommandExec => true
+    case _: CommandResultExec => true
+    case p: V2CommandExec =>
+      !FallbackTags.nonEmpty(p) && 
p.logicalLink.forall(FallbackTags.getOption(_).isEmpty)
+    case _: DataWritingCommandExec => true
+    case _: WholeStageCodegenExec => true
+    case _: WholeStageTransformer => true
+    case _: InputAdapter => true
+    case _: ColumnarInputAdapter => true
+    case _: InputIteratorTransformer => true
+    case _: ColumnarToRowTransition => true
+    case _: RowToColumnarTransition => true
+    case _: ReusedExchangeExec => true
+    case _: NoopLeaf => true
+    case w: WriteFilesExec => w.child.isInstanceOf[NoopLeaf]
+    case _: AdaptiveSparkPlanExec => true
+    case _: QueryStageExec => true
+    case _: AQEShuffleReadExec => true
+    case _: ColumnarAQEShuffleReadExec => true
+    case i: InMemoryTableScanExec => PlanUtil.isGlutenTableCache(i)

Review Comment:
   Make sense, remove it here.



-- 
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]

Reply via email to