Skip to content

functions_boolean.yaml

This document file is generated for functions_boolean.yaml. The extension URN is extension:io.substrait:functions_boolean.

Scalar Functions

or

*The boolean or using Kleene logic. 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. Behavior for 0 or 1 inputs is as follows: or() -> false or(x) -> x*

Implementations:

  • or(a: boolean?): -> boolean?

and

*The boolean and using Kleene logic. 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. Behavior for 0 or 1 inputs is as follows: and() -> true and(x) -> x*

Implementations:

  • and(a: boolean?): -> boolean?

and_not

*The boolean and of one value and the negation of the other using Kleene logic. This function behaves as follows with nulls:

true and not null = null

null and not false = null

false and not null = false

null and not true = false

null and not null = null

In other words, in this context a null value really means “unknown”, and an unknown value and not true is always false, as is false and not an unknown value.*

Implementations:

  • and_not(a: boolean?, b: boolean?): -> boolean?

xor

The boolean xor of two values using Kleene logic. When a null is encountered in either input, a null is output.

Implementations:

  • xor(a: boolean?, b: boolean?): -> boolean?

not

The not of a boolean value. When a null is input, a null is output.

Implementations:

  • not(a: boolean?): -> boolean?

Aggregate Functions

bool_and

If any value in the input is false, false is returned. If the input is empty or only contains nulls, null is returned. Otherwise, true is returned.

Implementations:

  • bool_and(a: boolean): -> boolean?

bool_or

If any value in the input is true, true is returned. If the input is empty or only contains nulls, null is returned. Otherwise, false is returned.

Implementations:

  • bool_or(a: boolean): -> boolean?