MaxGekk commented on code in PR #48121:
URL: https://github.com/apache/spark/pull/48121#discussion_r1762637179


##########
sql/api/src/main/scala/org/apache/spark/sql/internal/types/AbstractStringType.scala:
##########
@@ -51,3 +51,14 @@ case object StringTypeBinaryLcase extends AbstractStringType 
{
 case object StringTypeAnyCollation extends AbstractStringType {
   override private[sql] def acceptsType(other: DataType): Boolean = 
other.isInstanceOf[StringType]
 }
+
+/**
+ * Use StringTypeNonCSAICollation for expressions supporting all possible 
collation types
+ * except CS_AI collation types.
+ */
+case object StringTypeNonCSAICollation extends AbstractStringType {
+  override private[sql] def acceptsType(other: DataType): Boolean =
+    other.isInstanceOf[StringType] &&
+      (!other.asInstanceOf[StringType].typeName.contains("_AI") ||
+      other.asInstanceOf[StringType].typeName.contains("_CI"))

Review Comment:
   Why do you use the complex expression? From the PR description and function 
name, you need to exclude only `CS_AI`.



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