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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -559,6 +557,19 @@ case class BinaryPredicate(override val prettyName: 
String, left: Expression, ri
   }
 }
 
+trait CollationCheck {
+  self: BinaryExpression =>
+  def checkCollationIds(): Int = {
+    val leftCollationId: Int = 
left.dataType.asInstanceOf[StringType].collationId
+    val rightCollationId: Int = 
right.dataType.asInstanceOf[StringType].collationId
+    if (leftCollationId != rightCollationId) {
+      throw new IllegalArgumentException(
+        "Function requires the same collation type for left and right 
strings.")

Review Comment:
   Should be taken care of with new error classes (latest commit)



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -559,6 +557,19 @@ case class BinaryPredicate(override val prettyName: 
String, left: Expression, ri
   }
 }
 
+trait CollationCheck {
+  self: BinaryExpression =>

Review Comment:
   Done!



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