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

Returns lhs LIKE rhs operation.

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_scalar;

let array = Utf8Array::<i32>::from_slice(&["Arrow", "Arrow", "Arrow", "BA"]);

let result = like_utf8_scalar(&array, &"A%").unwrap();
assert_eq!(result, BooleanArray::from_slice(&[true, true, true, false]));