Function lt_eq

Source
pub fn lt_eq(lhs: ExprRef, rhs: ExprRef) -> ExprRef
Expand description

Create a new BinaryExpr using the Lte operator.

ยงExample usage

use vortex_array::arrays::{BoolArray, PrimitiveArray };
use vortex_array::{IntoArray, ToCanonical};
use vortex_array::validity::Validity;
use vortex_buffer::buffer;
use vortex_expr::{root, lit, lt_eq, Scope};

let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
let result = lt_eq(root(), lit(2)).evaluate(&Scope::new(xs.to_array())).unwrap();

assert_eq!(
    result.to_bool().unwrap().boolean_buffer(),
    BoolArray::from_iter(vec![true, true, false]).boolean_buffer(),
);