cloud-fan commented on code in PR #47621:
URL: https://github.com/apache/spark/pull/47621#discussion_r1709548336
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationSupport.java:
##########
@@ -62,33 +60,11 @@ public static UTF8String[] execBinary(final UTF8String
string, final UTF8String
return string.splitSQL(delimiter, -1);
}
public static UTF8String[] execLowercase(final UTF8String string, final
UTF8String delimiter) {
- if (delimiter.numBytes() == 0) return new UTF8String[] { string };
- if (string.numBytes() == 0) return new UTF8String[] {
UTF8String.EMPTY_UTF8 };
- Pattern pattern = Pattern.compile(Pattern.quote(delimiter.toString()),
- CollationSupport.lowercaseRegexFlags);
- String[] splits = pattern.split(string.toString(), -1);
- UTF8String[] res = new UTF8String[splits.length];
- for (int i = 0; i < res.length; i++) {
- res[i] = UTF8String.fromString(splits[i]);
- }
- return res;
+ return CollationAwareUTF8String.lowercaseSplitSQL(string, delimiter, -1);
}
public static UTF8String[] execICU(final UTF8String string, final
UTF8String delimiter,
Review Comment:
should all the callers call `CollationAwareUTF8String` instead of
`UTF8String` directly?
--
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]