findepi commented on code in PR #6662:
URL: https://github.com/apache/arrow-rs/pull/6662#discussion_r1826277398
##########
arrow-string/src/predicate.rs:
##########
@@ -116,10 +116,17 @@ impl<'a> Predicate<'a> {
}),
Predicate::Contains(finder) => {
if let Some(string_view_array) =
array.as_any().downcast_ref::<StringViewArray>() {
+ let nulls = string_view_array.logical_nulls();
BooleanArray::from(
string_view_array
.bytes_iter()
- .map(|haystack| finder.find(haystack).is_some() !=
negate)
+ .enumerate()
+ .map(|(idx, haystack)| {
+ if nulls.as_ref().map(|n|
n.is_null(idx)).unwrap_or_default() {
Review Comment:
For now i am more concerned about correctness. Producing fast but wrong
results isn't as useful.
i changed contains to to use `from_unary`, that seemed trivially good.
@tustvold might this be it doesn't use `from_unary` because it wants to use
``prefix_bytes_iter`` and `suffix_bytes_iter`? Please advise! I think we can
switch all operations to `from_unary` to fix correctness and leave tuning
performance to a follow-up.
--
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]