Function arrow_string::like::like
source ยท pub fn like(
left: &dyn Datum,
right: &dyn Datum,
) -> Result<BooleanArray, ArrowError>
Expand description
Perform SQL left LIKE right
There are two wildcards supported with the LIKE operator:
%
- The percent sign represents zero, one, or multiple characters_
- The underscore represents a single character
For example:
let strings = StringArray::from(vec!["Arrow", "Arrow", "Arrow", "Ar"]);
let patterns = StringArray::from(vec!["A%", "B%", "A.", "A_"]);
let result = like(&strings, &patterns).unwrap();
assert_eq!(result, BooleanArray::from(vec![true, false, false, true]));