uros-db commented on code in PR #45791:
URL: https://github.com/apache/spark/pull/45791#discussion_r1549406709
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -179,12 +179,26 @@ public static StringSearch getStringSearch(
final UTF8String left,
final UTF8String right,
final int collationId) {
+
+ if (collationId == UTF8_BINARY_LCASE_COLLATION_ID) {
+ return getStringSearch(left, right);
+ }
+
String pattern = right.toString();
CharacterIterator target = new StringCharacterIterator(left.toString());
Collator collator = CollationFactory.fetchCollation(collationId).collator;
return new StringSearch(pattern, target, (RuleBasedCollator) collator);
}
+ private static StringSearch getStringSearch(
Review Comment:
@miland-db this function shouldn't lowercase any input, regardless of its
access modifier
instead, do this when calling it (for UTF8_BINARY_LCASE):
`getStringSearch(left.toLowerCase(), right.toLowerCase())`
(this goes for other PRs that may use this too)
--
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]