pub fn like_binary<O: Offset>(
lhs: &BinaryArray<O>,
rhs: &BinaryArray<O>
) -> Result<BooleanArray>
Available on crate feature
compute_like
only.Expand description
Returns lhs LIKE rhs
operation on two BinaryArray
.
There are two wildcards supported:
%
- The percent sign represents zero, one, or multiple characters_
- The underscore represents a single character
Error
Errors iff:
- the arrays have a different length
- any of the patterns is not valid
Example
use arrow2::array::{BinaryArray, BooleanArray};
use arrow2::compute::like::like_binary;
let strings = BinaryArray::<i32>::from_slice(&["Arrow", "Arrow", "Arrow", "Arrow", "Ar"]);
let patterns = BinaryArray::<i32>::from_slice(&["A%", "B%", "%r_ow", "A_", "A_"]);
let result = like_binary(&strings, &patterns).unwrap();
assert_eq!(result, BooleanArray::from_slice(&[true, false, true, false, true]));