ChenMichael commented on a change in pull request #34036:
URL: https://github.com/apache/spark/pull/34036#discussion_r712473594
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/ExplainUtils.scala
##########
@@ -148,7 +148,7 @@ object ExplainUtils extends AdaptiveSparkPlanHelper {
setOpId(p)
case other: QueryPlan[_] =>
Review comment:
Duplication of node IDs seems to only happens with following requirements
1. Node has inner children
2. Node isn't the root
3. One of the inner children is a query plan.
I think `InMemoryRelation` and `InMemoryTableScanExec` are the only ones
that satisfy these requirements.
Moving `setOpId` to happen after `currentOperationID` will change the
numbering for nodes that satisfy requirements 1 and 3, but not 2 though.
It would change from something like
```
CommandResult (1)
Execute SaveIntoDataSourceCommand (2)
SaveIntoDataSourceCommand(3)
LogicalRelation(4)
```
to
```
CommandResult (4)
Execute SaveIntoDataSourceCommand (3)
SaveIntoDataSourceCommand(2)
LogicalRelation(1)
```
--
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]