pub fn nullif(lhs: &dyn Array, rhs: &dyn Array) -> Box<dyn Array> {
    assert_eq!(lhs.data_type(), rhs.data_type());
    assert_eq!(lhs.len(), rhs.len());

    use crate::datatypes::PhysicalType::*;
    match lhs.data_type().to_physical_type() {
        Primitive(primitive) => with_match_primitive_type!(primitive, |$T| {
            Box::new(primitive_nullif::<$T>(
                lhs.as_any().downcast_ref().unwrap(),
                rhs.as_any().downcast_ref().unwrap(),
            ))
        }),
        other => unimplemented!("Nullif is not implemented for physical type {:?}", other),
    }
}
/// Returns an [`Array`] with the same type as `lhs` and whose validity
/// is null iff either `lhs == rhs` or `lhs` is null.
///
/// This has the same semantics as postgres - the validity of the rhs is ignored.
/// # Panics
/// This function panics iff
/// * The arguments do not have the same logical type
/// * The arguments do not have the same length
/// * The physical type is not supported for this operation (use [`can_nullif`] to check)
/// # Example
/// ```rust
/// # use arrow2::array::Int32Array;
/// # use arrow2::datatypes::DataType;
/// # use arrow2::compute::nullif::nullif;
/// # fn main() {
/// 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 = nullif(&lhs, &rhs);
///
/// let expected = Int32Array::from(&[None, None, Some(1), None, Some(1)]);
///
/// assert_eq!(expected, result.as_ref());
/// # }
/// ```


This has the same semantics as postgres - the validity of the rhs is ignored.
This has the same semantics as postgres - the validity of the rhs is ignored .
pub fn nullif(lhs: &dyn Array, rhs: &dyn Array) -> Box<dyn Array> {
    assert_eq!(lhs.data_type(), rhs.data_type());
    assert_eq!(lhs.len(), rhs.len());
    use crate::datatypes::PhysicalType::*;
    match lhs.data_type().to_physical_type() {
        Primitive(primitive) => with_match_primitive_type!(primitive, |$T| {
            Box::new(primitive_nullif::<$T>(
                lhs.as_any().downcast_ref().unwrap(),
                rhs.as_any().downcast_ref().unwrap(),
            ))
        }),
        other => unimplemented!("Nullif is not implemented for physical type {:?}", other),
    }
}
pub fn nullif ( lhs : & dyn Array , rhs : & dyn Array ) -> Box < dyn Array > { assert_eq ! ( lhs data_type ( ) rhs data_type ( ) ) ; assert_eq ! ( lhs len ( ) rhs len ( ) ) ; use crate :: datatypes :: PhysicalType :: * ; match lhs . data_type ( ) . to_physical_type ( ) { Primitive ( primitive ) => with_match_primitive_type ! ( primitive $ T { Box new ( primitive_nullif $ T ( lhs as_any ( ) downcast_ref ( ) unwrap ( ) rhs as_any ( ) downcast_ref ( ) unwrap ( ) ) ) } ) , other => unimplemented ! ( " " other ) , } }
Returns an [`Array`] with the same type as `lhs` and whose validity
is null iff either `lhs == rhs` or `lhs` is null.
Returns an [ ` Array ` ] with the same type as ` lhs ` and whose validity is null iff either ` lhs == rhs ` or ` lhs ` is null .
lhs
&dyn Array
rhs
&dyn Array
lhs
&dyn Array
rhs
&dyn Array
panics
This function panics iff
The arguments do not have the same logical type
The arguments do not have the same length
The physical type is not supported for this operation (use [`can_nullif`] to check)
This function panics iff The arguments do not have the same logical type The arguments do not have the same length The physical type is not supported for this operation ( use [ ` can_nullif ` ] to check )
example
None
use arrow2::array::int32array;
None
use arrow2::datatypes::datatype;
None
use arrow2::compute::nullif::nullif;
None
fn main() {


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

assert_eq!(expected, result.as_ref()).
let expected = Int32Array :: from ( & [ None None Some ( 1 ) None Some ( 1 ) ] ) . assert_eq! ( expected result . as_ref () ) .
}
None