apache / arrow-rs

Official Rust implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
2.62k stars 802 forks source link

Incorrect like results for pattern starting/ending with `%` percent and containing escape characters #6702

Closed findepi closed 1 week ago

findepi commented 2 weeks ago

This should pass, but doesn't

// %...  pattern with escapes
assert_eq!(
    like(
        &StringArray::from_iter_values([r"abc\d"]),
        &StringArray::from_iter_values([r"%c\\d"])
    )
    .unwrap(),
    BooleanArray::from(vec![true])
);
// ...%  pattern with escapes
assert_eq!(
    like(
        &StringArray::from_iter_values([r"a\bcd"]),
        &StringArray::from_iter_values([r"a\\b%"])
    )
    .unwrap(),
    BooleanArray::from(vec![true])
);
findepi commented 2 weeks ago

take

alamb commented 6 days ago

label_issue.py automatically added labels {'arrow'} from #6703