pub fn primitive_nullif<T>(
lhs: &PrimitiveArray<T>,
rhs: &PrimitiveArray<T>
) -> PrimitiveArray<T> where
T: NativeType + Simd8,
T::Simd: Simd8PartialEq,
Available on crate feature
compute_nullif
only.Expand description
Returns an array whose validity is null iff lhs == rhs
or lhs
is null.
This has the same semantics as postgres - the validity of the rhs is ignored.
Panic
This function panics iff
- The arguments do not have the same logical type
- The arguments do not have the same length
Example
let lhs = Int32Array::from(&[None, None, Some(1), Some(1), Some(1)]);
let rhs = Int32Array::from(&[None, Some(1), None, Some(1), Some(0)]);
let result = primitive_nullif(&lhs, &rhs);
let expected = Int32Array::from(&[None, None, Some(1), None, Some(1)]);
assert_eq!(expected, result);