pub fn and_kleene(
left: &BooleanArray,
right: &BooleanArray,
) -> Result<BooleanArray, ArrowError>
Expand description
Logical ‘and’ boolean values with Kleene logic
§Behavior
This function behaves as follows with nulls:
true
andnull
=null
null
andtrue
=null
false
andnull
=false
null
andfalse
=false
null
andnull
=null
In other words, in this context a null value really means "unknown", and an unknown value ‘and’ false is always false. For a different null behavior, see function "and".
§Example
let a = BooleanArray::from(vec![Some(true), Some(false), None]);
let b = BooleanArray::from(vec![None, None, None]);
let and_ab = and_kleene(&a, &b).unwrap();
assert_eq!(and_ab, BooleanArray::from(vec![None, Some(false), None]));
§Fails
If the operands have different lengths