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


##########
gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala:
##########
@@ -184,9 +183,14 @@ object GlutenAutoAdjustStageResourceProfile extends 
Logging {
   def collectStagePlan(plan: SparkPlan): ArrayBuffer[SparkPlan] = {
 
     def collectStagePlan(plan: SparkPlan, planNodes: ArrayBuffer[SparkPlan]): 
Unit = {
-      if (plan.isInstanceOf[DataWritingCommandExec] || 
plan.isInstanceOf[ExecutedCommandExec]) {
-        // todo: support set final stage's resource profile
-        return
+      plan match {
+        // V1/V2 writes have a physical computation child and must remain 
eligible for profiling.
+        case _: DataWritingCommandExec | _: V2TableWriteExec =>
+        case _: CommandResultExec | _: ExecutedCommandExec | _: V2CommandExec 
=>
+          // Most commands are DDL and expose no physical input plan. Only few 
commands
+          // (e.g. InsertIntoDataSourceDirCommand) have a physical child plan.

Review Comment:
   Mark it as a limitation because `RunnableCommand` does not expose the 
physical plan.



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