uros-db commented on code in PR #48121:
URL: https://github.com/apache/spark/pull/48121#discussion_r1764755062
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -921,6 +921,22 @@ public static int collationNameToId(String collationName)
throws SparkException
return Collation.CollationSpec.collationNameToId(collationName);
}
+ /**
+ * Returns whether the ICU collation is Case Insensitive for the given
collation id.
+ */
+ public static Boolean isCI(int collationId) {
+ return
Collation.CollationSpecICU.fromCollationId(collationId).caseSensitivity
+ == Collation.CollationSpecICU.CaseSensitivity.CI;
+ }
+
+ /**
+ * Returns whether the ICU collation is Accent Insensitive for the given
collation id.
+ */
+ public static Boolean isAI(int collationId) {
+ return
Collation.CollationSpecICU.fromCollationId(collationId).accentSensitivity
+ == Collation.CollationSpecICU.AccentSensitivity.AI;
+ }
+
Review Comment:
not sure whether adding these public methods to CollationFactory is the best
approach for the purposes of this PR
--
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]