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


##########
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:
##########
@@ -341,6 +340,15 @@ public boolean contains(final UTF8String substring) {
     return false;
   }
 
+  public boolean contains(final UTF8String substring, int collationId) {
+    if (collationId == CollationFactory.LOWERCASE_COLLATION_ID) {

Review Comment:
   Ahh, I see. Makes sense, I do agree that `contains(final UTF8String 
substring, int collationId)` should be able to handle all collations, even if 
it's not currently invoked for DEFAULT_COLLATION_ID. I added this in the latest 
commit!
   
   However, that same default option that works for DEFAULT_COLLATION_ID 
(UCS_BASIC) also works for other binary collations supported by 
CollationFactory (currently: UNICODE).
   
   I suppose we should go ahead and cover them all here using:
   `if (CollationFactory.fetchCollation(collationId).isBinaryCollation)`
   instead of just
   ` if (collationId == CollationFactory.DEFAULT_COLLATION_ID)`



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

Reply via email to