Skip to main content

zip

Function zip 

Source
pub fn zip(
    if_true: &dyn Array,
    if_false: &dyn Array,
    mask: &Mask,
) -> VortexResult<ArrayRef>
Expand description

Performs element-wise conditional selection between two arrays based on a mask.

Returns a new array where result[i] = if_true[i] when mask[i] is true, otherwise result[i] = if_false[i].

Null values in the mask are treated as false (selecting if_false). This follows SQL semantics (DuckDB, Trino) where a null condition falls through to the ELSE branch, rather than Arrow’s if_else which propagates null conditions to the output.