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


##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationSupport.java:
##########
@@ -169,6 +239,46 @@ private static boolean matchAt(final UTF8String target, 
final UTF8String pattern
         pos, pos + pattern.numChars()), pattern, collationId).last() == 0;
     }
 
+    private static int findInSet(UTF8String match, UTF8String set, int 
collationId) {
+      if (match.contains(UTF8String.fromString(","))) {
+        return 0;
+      }
+
+      StringSearch stringSearch = CollationFactory.getStringSearch(set, match, 
collationId);
+
+      String setString = set.toString();

Review Comment:
   and if you do that, I'd say that the UTF8String implementation for 
`getStringSearch` can amount to:
   
   ```
     public static StringSearch getStringSearch(
         final UTF8String left,
         final UTF8String right,
         final int collationId) {
       return getStringSearch(left.toString(), right.toString(), collationId);
     }
   ```
   
   this way, we can have a more complete API



-- 
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