Function arrow::compute::kernels::boolean::or_kleene[][src]

pub fn or_kleene(
    left: &BooleanArray,
    right: &BooleanArray
) -> Result<BooleanArray>
Expand description

Logical ‘or’ boolean values with Kleene logic

Behavior

This function behaves as follows with nulls:

  • true or null = true
  • null or true = true
  • false or null = null
  • null or false = null
  • null or null = null

In other words, in this context a null value really means "unknown", and an unknown value ‘or’ true is always true. For a different null behavior, see function "or".

Example

use arrow::array::BooleanArray;
use arrow::error::Result;
use arrow::compute::kernels::boolean::or_kleene;
let a = BooleanArray::from(vec![Some(true), Some(false), None]);
let b = BooleanArray::from(vec![None, None, None]);
let or_ab = or_kleene(&a, &b)?;
assert_eq!(or_ab, BooleanArray::from(vec![Some(true), None, None]));

Fails

If the operands have different lengths