File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ pub(crate) fn validate_percentile_expr(
5454 let percentile = match scalar_value {
5555 ScalarValue :: Float32 ( Some ( value) ) => value as f64 ,
5656 ScalarValue :: Float64 ( Some ( value) ) => value,
57+ ScalarValue :: Float32 ( None ) | ScalarValue :: Float64 ( None ) => {
58+ return plan_err ! (
59+ "Percentile value for '{fn_name}' must be Float32 or Float64 literal (got null)"
60+ ) ;
61+ }
5762 sv => {
5863 return plan_err ! (
5964 "Percentile value for '{fn_name}' must be Float32 or Float64 literal (got data type {})" ,
Original file line number Diff line number Diff line change @@ -1991,6 +1991,9 @@ SELECT APPROX_PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY v) FROM (VALUES (CAST(
19911991----
19921992NULL
19931993
1994+ query error DataFusion error: Error during planning: Percentile value for 'APPROX_PERCENTILE_CONT' must be Float32 or Float64 literal \(got null\)
1995+ SELECT APPROX_PERCENTILE_CONT(NULL) WITHIN GROUP (ORDER BY v) FROM (VALUES (CAST(NULL as INT))) as t (v);
1996+
19941997# percentile_cont_with_weight_with_nulls
19951998query R
19961999SELECT APPROX_PERCENTILE_CONT_WITH_WEIGHT(w, 0.5) WITHIN GROUP (ORDER BY v)
You can’t perform that action at this time.
0 commit comments