Skip to main content

is_constant

Function is_constant 

Source
pub fn is_constant(
    array: &ArrayRef,
    ctx: &mut ExecutionCtx,
) -> VortexResult<bool>
Expand description

Compute whether an array has constant values.

An array is constant IFF at least one of the following conditions apply:

  1. It has at least one element (Note - an empty array isn’t constant).
  2. It’s encoded as a ConstantArray or NullArray
  3. Has an exact statistic attached to it, saying its constant.
  4. Is all invalid.
  5. Is all valid AND has minimum and maximum statistics that are equal.