cboumalh commented on code in PR #54236:
URL: https://github.com/apache/spark/pull/54236#discussion_r2800414087
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1860,22 +1890,74 @@ object CombineUnions extends Rule[LogicalPlan] {
if projectList.forall(_.deterministic) && children.nonEmpty &&
flattenDistinct && byName == topByName && allowMissingCol ==
topAllowMissingCol &&
canPushProjectionThroughUnion(project) =>
- stack.pushAll(pushProjectionThroughUnion(projectList, u).reverse)
+ stack.pushAll(pushProjectionThroughUnionLike(projectList, u).reverse)
case project @ Project(projectList, Deduplicate(keys: Seq[Attribute],
u: Union))
if projectList.forall(_.deterministic) && flattenDistinct &&
u.byName == topByName &&
u.allowMissingCol == topAllowMissingCol && AttributeSet(keys) ==
u.outputSet &&
canPushProjectionThroughUnion(project) =>
- stack.pushAll(pushProjectionThroughUnion(projectList, u).reverse)
+ stack.pushAll(pushProjectionThroughUnionLike(projectList, u).reverse)
case project @ Project(projectList, u @ Union(children, byName,
allowMissingCol))
if projectList.forall(_.deterministic) && children.nonEmpty &&
byName == topByName &&
allowMissingCol == topAllowMissingCol &&
canPushProjectionThroughUnion(project) =>
- stack.pushAll(pushProjectionThroughUnion(projectList, u).reverse)
+ stack.pushAll(pushProjectionThroughUnionLike(projectList, u).reverse)
case child =>
flattened += child
}
}
union.copy(children = flattened.toSeq)
}
+
+ private def flattenSequentialStreamingUnion(
Review Comment:
yeah that's fair
--
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]