cloud-fan commented on code in PR #49351: URL: https://github.com/apache/spark/pull/49351#discussion_r1914421263
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala: ########## @@ -539,48 +588,56 @@ case class Union( children.length > 1 && !(byName || allowMissingCol) && childrenResolved && allChildrenCompatible } - private lazy val lazyOutput: Seq[Attribute] = computeOutput() + override protected def withNewChildrenInternal(newChildren: IndexedSeq[LogicalPlan]): Union = + copy(children = newChildren) +} - private def computeOutput(): Seq[Attribute] = Union.mergeChildOutputs(children.map(_.output)) +/** + * The logical node for recursion, that contains a initial (anchor) and a recursion describing term, + * that contains an [[UnionLoopRef]] node. + * The node is very similar to [[Union]] because the initial and "generated" children are union-ed + * and it is also similar to a loop because the recursion continues until the last generated child + * is not empty. + * + * @param id The id of the loop, inherited from [[CTERelationDef]] + * @param anchor The plan of the initial element of the loop. + * @param recursion The plan that describes the recursion with an [[UnionLoopRef]] node. + * @param limit An optional limit that can be pushed down to the node to stop the loop earlier. + */ +case class UnionLoop(id: Long, + anchor: LogicalPlan, Review Comment: ```suggestion case class UnionLoop( id: Long, anchor: LogicalPlan, ``` ########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala: ########## @@ -539,48 +588,56 @@ case class Union( children.length > 1 && !(byName || allowMissingCol) && childrenResolved && allChildrenCompatible } - private lazy val lazyOutput: Seq[Attribute] = computeOutput() + override protected def withNewChildrenInternal(newChildren: IndexedSeq[LogicalPlan]): Union = + copy(children = newChildren) +} - private def computeOutput(): Seq[Attribute] = Union.mergeChildOutputs(children.map(_.output)) +/** + * The logical node for recursion, that contains a initial (anchor) and a recursion describing term, Review Comment: ```suggestion * The logical node for recursion, that contains an initial (anchor) and a recursion describing term, ``` -- 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