cloud-fan commented on code in PR #48585:
URL: https://github.com/apache/spark/pull/48585#discussion_r1814477281
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:
##########
@@ -356,6 +367,71 @@ abstract class TypeCoercionBase {
plan
}
}
+
+ /** Builds new children for set operators while resolving collation
conflicts in respective
+ * children columns. This is being done before any other type widening
because STRING can also
+ * be casted to a different dataType, but conflicts between collations
have to be reported. */
+ private def buildNewChildrenWithResolvedCollation(
+ children: Seq[LogicalPlan]): Seq[LogicalPlan] = {
+ require(children.forall(_.output.length == children.head.output.length))
+ // Since this function is called for set operators, we can be sure that
their children
+ // are all `Project` nodes. An `assert` is added for double checking the
assumption.
Review Comment:
I'm confused, how do we guarantee it? The children of `Union` can be
anything, right?
--
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]