Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
like in datafusion::common::arrow::compute - Rust
[go: Go Back, main page]

Function like

Source
pub fn like(
    left: &dyn Datum,
    right: &dyn Datum,
) -> Result<BooleanArray, ArrowError>
Expand description

Perform SQL left LIKE right

ยงSupported DataTypes

left and right must be the same type, and one of

  • Utf8
  • LargeUtf8
  • Utf8View

There are two wildcards supported with the LIKE operator:

  1. % - The percent sign represents zero, one, or multiple characters
  2. _ - The underscore represents a single character

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]));