MCPcopy Create free account
hub / github.com/apache/arrow-rs / not

Function not

arrow-arith/src/boolean.rs:310–314  ·  view source on GitHub ↗

Performs unary `NOT` operation on an arrays. If value is null then the result is also null. # Error This function never errors. It returns an error for consistency. # Example ```rust # use arrow_array::BooleanArray; # use arrow_arith::boolean::not; let a = BooleanArray::from(vec![Some(false), Some(true), None]); let not_a = not(&a).unwrap(); assert_eq!(not_a, BooleanArray::from(vec![Some(true), So

(left: &BooleanArray)

Source from the content-addressed store, hash-verified

308/// assert_eq!(not_a, BooleanArray::from(vec![Some(true), Some(false), None]));
309/// ```
310pub fn not(left: &BooleanArray) -> Result<BooleanArray, ArrowError> {
311 let nulls = left.nulls().cloned();
312 let values = !left.values();
313 Ok(BooleanArray::new(values, nulls))
314}
315
316/// Returns a non-null [BooleanArray] with whether each value of the array is null.
317/// # Error

Callers 4

bench_notFunction · 0.85
compare_opFunction · 0.85
test_bool_array_notFunction · 0.85

Calls 2

nullsMethod · 0.45
valuesMethod · 0.45

Tested by 2

test_bool_array_notFunction · 0.68