StevenChenDatabricks commented on code in PR #40385: URL: https://github.com/apache/spark/pull/40385#discussion_r1142810230
########## sql/core/src/main/scala/org/apache/spark/sql/execution/ExplainUtils.scala: ########## @@ -73,14 +78,34 @@ object ExplainUtils extends AdaptiveSparkPlanHelper { */ def processPlan[T <: QueryPlan[T]](plan: T, append: String => Unit): Unit = { try { + // Initialize a reference-unique set of Operators to avoid accdiental overwrites and to allow + // intentional overwriting of IDs generated in previous AQE iteration + val operators = newSetFromMap[QueryPlan[_]](new IdentityHashMap()) Review Comment: `SparkPlan` has ID but not all `QueryPlan` have ID and this function allows all `QueryPlan`. I attempted creating HashMap of IDs and casting the `plan` argument as a `SparkPlan` but it would fail some tests cases where the node isn't a `SparkPlan`. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org