mihailom-db commented on code in PR #49340: URL: https://github.com/apache/spark/pull/49340#discussion_r1901857795
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionBase.scala: ########## @@ -326,6 +326,18 @@ abstract class TypeCoercionBase extends TypeCoercionHelper { } } + object CastCoercion extends TypeCoercionRule { + + override val transform: PartialFunction[Expression, Expression] = { + case c @ Cast(child, dataType, _, _) if child.resolved => (child.dataType, dataType) match { Review Comment: Could we maybe match here on Cast(child, CharType(_)) and same for Varchar. In that way we skip the need for second match. -- 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