dbatomic commented on code in PR #45216: URL: https://github.com/apache/spark/pull/45216#discussion_r1502776606
########## 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: Add a bit more information here. E.g. left was = ..., right was .... -- 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