uros-db commented on code in PR #45383:
URL: https://github.com/apache/spark/pull/45383#discussion_r1515613758


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -509,18 +509,10 @@ abstract class StringPredicate extends BinaryExpression
       return checkResult
     }
     // Additional check needed for collation compatibility
-    val rightCollationId: Int = 
right.dataType.asInstanceOf[StringType].collationId
-    if (collationId != rightCollationId) {
-      DataTypeMismatch(
-        errorSubClass = "COLLATION_MISMATCH",
-        messageParameters = Map(
-          "collationNameLeft" -> 
CollationFactory.fetchCollation(collationId).collationName,
-          "collationNameRight" -> 
CollationFactory.fetchCollation(rightCollationId).collationName
-        )
-      )
-    } else {
-      TypeCheckResult.TypeCheckSuccess
-    }
+    val outputCollationId: Int = TypeCoercion

Review Comment:
   also note that in:
   `final lazy val collationId: Int = 
left.dataType.asInstanceOf[StringType].collationId`
   
   `left` is chosen arbitrarily, and shouldn't be used to check whether a 
function supports that collation type _before_ checking whether `right` has the 
same collation



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