cloud-fan commented on code in PR #45383: URL: https://github.com/apache/spark/pull/45383#discussion_r1547239943
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala: ########## @@ -702,26 +707,39 @@ abstract class TypeCoercionBase { }.getOrElse(b) // If there is no applicable conversion, leave expression unchanged. case e: ImplicitCastInputTypes if e.inputTypes.nonEmpty => - val children: Seq[Expression] = e.children.zip(e.inputTypes).map { case (in, expected) => + val childrenBeforeCollations: Seq[Expression] = e.children.zip(e.inputTypes).map { // If we cannot do the implicit cast, just use the original input. - implicitCast(in, expected).getOrElse(in) + case (in, expected) => implicitCast(in, expected).getOrElse(in) + } + val st = getOutputCollation(e.children) + val children: Seq[Expression] = childrenBeforeCollations.map { Review Comment: It seems we are fixing the problem at the wrong place. If `TypeCollections` has issues, let's update the code in `def implicitCast` to fix it. -- 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