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

Function is_null

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

Returns a non-null [BooleanArray] with whether each value of the array is null. # Error This function never errors. # Example ```rust # use arrow_array::BooleanArray; # use arrow_arith::boolean::is_null; let a = BooleanArray::from(vec![Some(false), Some(true), None]); let a_is_null = is_null(&a).unwrap(); assert_eq!(a_is_null, BooleanArray::from(vec![false, false, true])); ```

(input: &dyn Array)

Source from the content-addressed store, hash-verified

325/// assert_eq!(a_is_null, BooleanArray::from(vec![false, false, true]));
326/// ```
327pub fn is_null(input: &dyn Array) -> Result<BooleanArray, ArrowError> {
328 let values = match input.logical_nulls() {
329 None => BooleanBuffer::new_unset(input.len()),
330 Some(nulls) => !nulls.inner(),
331 };
332
333 Ok(BooleanArray::new(values, None))
334}
335
336/// Returns a non-null [BooleanArray] with whether each value of the array is not null.
337/// # Error

Calls 3

logical_nullsMethod · 0.45
lenMethod · 0.45
innerMethod · 0.45