uros-db commented on code in PR #45704:
URL: https://github.com/apache/spark/pull/45704#discussion_r1547414846
##########
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 getStringSearchUTF8LCase(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 getStringSearchUTF8LCase(
Review Comment:
I would prefer:
```
public static StringSearch getStringSearch(
final UTF8String patternUTF8String,
final UTF8String targetUTF8String) {
return new StringSearch(patternUTF8String.toString(),
targetUTF8String.toString());
}
```
and then:
`getStringSearch(left.toLowerCase(), right.toLowerCase())` on line 184
this version of "getStringSearch" may come in handy in the future, so I
think we can do this straight away
--
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]