tustvold commented on code in PR #3306:
URL: https://github.com/apache/arrow-rs/pull/3306#discussion_r1044555495


##########
arrow-string/src/like.rs:
##########
@@ -588,50 +588,45 @@ fn ilike_scalar_op<'a, F: Fn(bool) -> bool, L: 
ArrayAccessor<Item = &'a str>>(
     right: &str,
     op: F,
 ) -> Result<BooleanArray, ArrowError> {
-    if !right.contains(is_like_pattern) {
-        // fast path, can use equals
-        let right_uppercase = right.to_uppercase();
-
-        Ok(BooleanArray::from_unary(left, |item| {
-            op(item.to_uppercase() == right_uppercase)
-        }))
-    } else if right.ends_with('%')
-        && !right.ends_with("\\%")
-        && !right[..right.len() - 1].contains(is_like_pattern)
-    {
-        // fast path, can use starts_with
-        let start_str = &right[..right.len() - 1].to_uppercase();
-        Ok(BooleanArray::from_unary(left, |item| {
-            op(item.to_uppercase().starts_with(start_str))
-        }))
-    } else if right.starts_with('%') && !right[1..].contains(is_like_pattern) {
-        // fast path, can use ends_with
-        let ends_str = &right[1..].to_uppercase();
+    // If not ASCII faster to use case insensitive regex than allocating using 
to_uppercase

Review Comment:
   ?



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

Reply via email to