File tree Expand file tree Collapse file tree
vortex-array/src/scalar_fn/fns/fill_null Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44use vortex_error:: VortexExpect ;
55use vortex_error:: VortexResult ;
6+ use vortex_error:: vortex_ensure;
67
78use crate :: ArrayRef ;
89use crate :: ExecutionCtx ;
@@ -57,6 +58,11 @@ pub(super) fn precondition(
5758 array : & ArrayRef ,
5859 fill_value : & Scalar ,
5960) -> VortexResult < Option < ArrayRef > > {
61+ vortex_ensure ! (
62+ !fill_value. is_null( ) ,
63+ "fill_null requires a non-null fill value"
64+ ) ;
65+
6066 // If the array has no nulls, fill_null is a no-op (just cast for nullability).
6167 if !array. dtype ( ) . is_nullable ( ) || array. all_valid ( ) ? {
6268 return array. to_array ( ) . cast ( fill_value. dtype ( ) . clone ( ) ) . map ( Some ) ;
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ impl ScalarFnVTable for FillNull {
105105 . as_constant ( )
106106 . ok_or_else ( || vortex_err ! ( "fill_null fill_value must be a constant/scalar" ) ) ?;
107107
108+ vortex_ensure ! (
109+ !fill_scalar. is_null( ) ,
110+ "fill_null requires a non-null fill value"
111+ ) ;
112+
108113 let Some ( columnar) = input. as_opt :: < AnyColumnar > ( ) else {
109114 return input. execute :: < ArrayRef > ( ctx) ?. fill_null ( fill_scalar) ;
110115 } ;
You can’t perform that action at this time.
0 commit comments