pub fn or_scalar(array: &BooleanArray, scalar: &BooleanScalar) -> BooleanArray {
    match scalar.value() {
        Some(true) => {
            let mut values = MutableBitmap::new();
            values.extend_constant(array.len(), true);
            BooleanArray::from_data(DataType::Boolean, values.into(), None)
        }
        Some(false) => array.clone(),
        None => {
            let values = array.values();
            let validity = match array.validity() {
                Some(validity) => binary(values, validity, |value, validity| validity & value),
                None => unary(values, |value| value),
            };
            BooleanArray::from_data(DataType::Boolean, values.clone(), Some(validity))
        }
    }
}
/// Logical 'or' operation on an array and a scalar value with [Kleene logic](https://en.wikipedia.org/wiki/Three-valued_logic#Kleene_and_Priest_logics)
/// # Example
///
/// ```rust
/// use arrow2::array::BooleanArray;
/// use arrow2::scalar::BooleanScalar;
/// use arrow2::compute::boolean_kleene::or_scalar;
/// # fn main() {
/// let array = BooleanArray::from(&[Some(true), Some(false), None]);
/// let scalar = BooleanScalar::new(Some(false));
/// let result = or_scalar(&array, &scalar);
/// assert_eq!(result, BooleanArray::from(&[Some(true), Some(false), None]));
/// # }
/// ```
Logical 'or' operation on an array and a scalar value with [Kleene logic]
Logical ' or ' operation on an array and a scalar value with [ Kleene logic ]
pub fn or_scalar(array: &BooleanArray, scalar: &BooleanScalar) -> BooleanArray {
    match scalar.value() {
        Some(true) => {
            let mut values = MutableBitmap::new();
            values.extend_constant(array.len(), true);
            BooleanArray::from_data(DataType::Boolean, values.into(), None)
        }
        Some(false) => array.clone(),
        None => {
            let values = array.values();
            let validity = match array.validity() {
                Some(validity) => binary(values, validity, |value, validity| validity & value),
                None => unary(values, |value| value),
            };
            BooleanArray::from_data(DataType::Boolean, values.clone(), Some(validity))
        }
    }
}
pub fn or_scalar ( array : & BooleanArray , scalar : & BooleanScalar ) -> BooleanArray { match scalar . value ( ) { Some ( true ) => { let mut values = MutableBitmap :: new ( ) ; values . extend_constant ( array . len ( ) , true ) ; BooleanArray :: from_data ( DataType :: Boolean , values . into ( ) , None ) } Some ( false ) => array . clone ( ) , None => { let values = array . values ( ) ; let validity = match array . validity ( ) { Some ( validity ) => binary ( values , validity , | value , validity | validity & value ) , None => unary ( values , | value | value ) , } ; BooleanArray :: from_data ( DataType :: Boolean , values . clone ( ) , Some ( validity ) ) } } }
Logical 'or' operation on an array and a scalar value with [Kleene logic](https://en.wikipedia.org/wiki/Three-valued_logic#Kleene_and_Priest_logics)
Logical ' or ' operation on an array and a scalar value with [ Kleene logic ] ( https : // en . wikipedia . org / wiki / Three - valued_logic#Kleene_and_Priest_logics )
array
&BooleanArray
scalar
&BooleanScalar
array
&BooleanArray
scalar
&BooleanScalar
example
```rust
use arrow2::array::BooleanArray;
use arrow2::scalar::BooleanScalar;
use arrow2::compute::boolean_kleene::or_scalar.
` ` ` rust use arrow2 :: array :: BooleanArray ; use arrow2 :: scalar :: BooleanScalar ; use arrow2 :: compute :: boolean_kleene :: or_scalar .
fn main() {
let array = BooleanArray::from(&[Some(true), Some(false), None]);
let scalar = BooleanScalar::new(Some(false));
let result = or_scalar(&array, &scalar);
assert_eq!(result, BooleanArray::from(&[Some(true), Some(false), None])).
let array = BooleanArray :: from ( & [ Some ( true ) Some ( false ) None ] ) ; let scalar = BooleanScalar :: new ( Some ( false )) ; let result = or_scalar ( &array &scalar ) ; assert_eq! ( result BooleanArray :: from ( & [ Some ( true ) Some ( false ) None ] )) .
}
None