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

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

Logical ‘and’ boolean values with Kleene logic

Behavior

This function behaves as follows with nulls:

  • true and null = null
  • null and true = null
  • false and null = false
  • null and false = false
  • null and null = 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

use arrow::array::BooleanArray;
use arrow::error::Result;
use arrow::compute::kernels::boolean::and_kleene;
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)?;
assert_eq!(and_ab, BooleanArray::from(vec![None, Some(false), None]));

Fails

If the operands have different lengths