pub fn like_binary_scalar<O: Offset>(
    lhs: &BinaryArray<O>,
    rhs: &[u8]
) -> 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::{BinaryArray, BooleanArray};
use arrow2::compute::like::like_binary_scalar;

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

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