uros-db commented on code in PR #45791:
URL: https://github.com/apache/spark/pull/45791#discussion_r1549415554


##########
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);
   }
 

Review Comment:
   if you do end up making this a public method, add a comment such as:
   ```
     /**
      * Creates an instance of ICU's StringSearch with provided parameters.
      * @param targetUTF8String UTF8String representation of the string to be 
searched.
      * @param patternUTF8String UTF8String representation of the string to 
search for.
      * @return Created instance of StringSearch.
      */
   ```



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to