Skip to content

Commit

Permalink
Fix: fill_null fallback will not infinitely recurse (#1607)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Dec 8, 2024
1 parent f446aee commit a4b2b05
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vortex-array/src/compute/fill_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,14 @@ pub fn fill_null(array: impl AsRef<ArrayData>, fill_value: Scalar) -> VortexResu
return fill_null_fn.fill_null(array, fill_value);
}

fill_null(array.clone().into_canonical()?.into_array(), fill_value)
let canonical_arr = array.clone().into_canonical()?.into_array();
if let Some(fill_null_fn) = canonical_arr.encoding().fill_null_fn() {
return fill_null_fn.fill_null(&canonical_arr, fill_value);
}

vortex_bail!(
"fill null not implemented for canonical encoding {}, fallback from {}",
canonical_arr.encoding().id(),
array.encoding().id()
)
}

0 comments on commit a4b2b05

Please sign in to comment.