apache / arrow-rs

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

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

Open findepi opened 2 hours ago

findepi commented 2 hours 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 hours ago

take