diff --git a/arrow-string/src/predicate.rs b/arrow-string/src/predicate.rs index 2bff39786edb..15a5cee6c40e 100644 --- a/arrow-string/src/predicate.rs +++ b/arrow-string/src/predicate.rs @@ -114,27 +114,9 @@ impl<'a> Predicate<'a> { Predicate::IEqAscii(v) => BooleanArray::from_unary(array, |haystack| { haystack.eq_ignore_ascii_case(v) != negate }), - Predicate::Contains(finder) => { - if let Some(string_view_array) = array.as_any().downcast_ref::() { - let nulls = string_view_array.logical_nulls(); - BooleanArray::from( - string_view_array - .bytes_iter() - .enumerate() - .map(|(idx, haystack)| { - if nulls.as_ref().map(|n| n.is_null(idx)).unwrap_or_default() { - return None; - } - Some(finder.find(haystack).is_some() != negate) - }) - .collect::>(), - ) - } else { - BooleanArray::from_unary(array, |haystack| { - finder.find(haystack.as_bytes()).is_some() != negate - }) - } - } + Predicate::Contains(finder) => BooleanArray::from_unary(array, |haystack| { + finder.find(haystack.as_bytes()).is_some() != negate + }), Predicate::StartsWith(v) => { if let Some(string_view_array) = array.as_any().downcast_ref::() { let nulls = string_view_array.logical_nulls();