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
split_binary_owned in datafusion_expr::utils - Rust
[go: Go Back, main page]

Function split_binary_owned

Source
pub fn split_binary_owned(expr: Expr, op: Operator) -> Vec<Expr>
Expand description

Splits an owned binary operator tree Expr such as A <OP> B <OP> C => [A, B, C]

This is often used to “split” expressions such as col1 = 5 AND col2 = 10 into [col1 = 5, col2 = 10];

§Example

// a=1 + b=2
let expr = col("a").eq(lit(1)).add(col("b").eq(lit(2)));

// [a=1, b=2]
let split = vec![
  col("a").eq(lit(1)),
  col("b").eq(lit(2)),
];

// use split_binary_owned to split them
assert_eq!(split_binary_owned(expr, Operator::Plus), split);