cloud-fan commented on code in PR #45819:
URL: https://github.com/apache/spark/pull/45819#discussion_r1575738320


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCasts.scala:
##########
@@ -118,17 +121,21 @@ object CollationTypeCasts extends TypeCoercionRule {
           )
       // Only implicit or default collations present
       case 0 =>
-        val implicitTypes = expr.map(_.dataType)
+        val implicitTypes = expr.filter {
+            case Literal(_, _: StringType) => false
+            case Cast(child, _: StringType, _, _) => 
child.dataType.isInstanceOf[StringType]

Review Comment:
   Let's also check `cast.getTagValue(Cast.USER_SPECIFIED_CAST).isEmpty` to 
make sure it's not a user-specified cast.



-- 
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]

Reply via email to