pub fn like_utf8<O: Offset>(
    lhs: &Utf8Array<O>,
    rhs: &Utf8Array<O>
) -> Result<BooleanArray>
Available on crate feature compute_like only.
Expand description

Returns lhs LIKE rhs operation on two Utf8Array.

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::{Utf8Array, BooleanArray};
use arrow2::compute::like::like_utf8;

let strings = Utf8Array::<i32>::from_slice(&["Arrow", "Arrow", "Arrow", "Arrow", "Ar"]);
let patterns = Utf8Array::<i32>::from_slice(&["A%", "B%", "%r_ow", "A_", "A_"]);

let result = like_utf8(&strings, &patterns).unwrap();
assert_eq!(result, BooleanArray::from_slice(&[true, false, true, false, true]));