pub fn primitive_nullif_scalar<T>(
    lhs: &PrimitiveArray<T>,
    rhs: T
) -> PrimitiveArray<T> where
    T: NativeType + Simd8,
    T::Simd: Simd8PartialEq
Available on crate feature compute_nullif only.
Expand description

Returns a PrimitiveArray whose validity is null iff lhs == rhs or lhs is null.

This has the same semantics as postgres.

Panic

This function panics iff

  • The arguments do not have the same logical type

Example

let lhs = Int32Array::from(&[None, None, Some(1), Some(0), Some(1)]);
let result = primitive_nullif_scalar(&lhs, 0);

let expected = Int32Array::from(&[None, None, Some(1), None, Some(1)]);

assert_eq!(expected, result);