MaxGekk commented on code in PR #48804:
URL: https://github.com/apache/spark/pull/48804#discussion_r1834614134
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -509,6 +509,10 @@ private CollationSpecUTF8(
private static int collationNameToId(String originalName, String
collationName)
throws SparkException {
+ // Have a check for UTF8_BINARY collation to early-out and not
introduce any regression.
+ if (UTF8_BINARY_COLLATION.collationName.equals(collationName)) {
Review Comment:
You could avoid double comparison to `UTF8_BINARY_COLLATION` if you modify
the `if` below like:
```java
if (collationName.startsWith(UTF8_BINARY_COLLATION.collationName)) {
if (collationName.length() ==
UTF8_BINARY_COLLATION.collationName.length()) {
return UTF8_BINARY_COLLATION_ID;
}
```
The same is applicable to the prefix: `UTF8_LCASE_COLLATION`
--
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]