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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala:
##########
@@ -168,7 +171,12 @@ object AnsiTypeCoercion extends TypeCoercionBase {
 
       // If a function expects a StringType, no StringType instance should be 
implicitly cast to
       // StringType with a collation that's not accepted (aka. lockdown 
unsupported collations).
-      case (_: StringType, _: StringType) => None
+      case (s1: StringType, s2: StringType) =>
+        if (s1.collationId == s2.collationId && 
StringHelper.isMoreConstrained(s1, s2)) {

Review Comment:
   how is it different from `StringHelper.tightestCommonString(s1, s2)`?



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

Reply via email to