cloud-fan commented on code in PR #53526:
URL: https://github.com/apache/spark/pull/53526#discussion_r2639774745


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/normalizer/NormalizeCTEIds.scala:
##########
@@ -17,38 +17,50 @@
 
 package org.apache.spark.sql.catalyst.normalizer
 
+import java.util.HashMap
+import java.util.concurrent.atomic.AtomicLong
+
 import org.apache.spark.sql.catalyst.plans.logical.{CacheTableAsSelect, 
CTERelationRef, LogicalPlan, UnionLoop, UnionLoopRef, WithCTE}
 import org.apache.spark.sql.catalyst.rules.Rule
 
-object NormalizeCTEIds extends Rule[LogicalPlan]{
+object NormalizeCTEIds extends Rule[LogicalPlan] {
   override def apply(plan: LogicalPlan): LogicalPlan = {
     val curId = new java.util.concurrent.atomic.AtomicLong()
-    plan transformDown {
+    val defIdToNewId = new HashMap[Long, Long]()
+    applyInternal(plan, curId, defIdToNewId)
+  }
 
+  private def applyInternal(
+      plan: LogicalPlan,
+      curId: AtomicLong,
+      defIdToNewId: HashMap[Long, Long]): LogicalPlan = {

Review Comment:
   ```suggestion
         cteIdToNewId: HashMap[Long, Long]): LogicalPlan = {
   ```



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