You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support column reference as percentile arg for percentile_cont and approx_percentile_cont #24337
@Jefffrey We're hitting an issue when the percentile comes from a projection. The behavior would be the same as for Trino: the percentile argument must be constant for all inputs. So yes, essentially it would be a ScalarValue (not always folded into a ScalarValue).
/// Validates that a percentile expression is a literal float value between 0.0 and 1.0.
///
/// Used by both `percentile_cont` and `approx_percentile_cont` to validate their
/// percentile parameters.
pub(crate)fnvalidate_percentile_expr(
expr:&Arc<dynPhysicalExpr>,
fn_name:&str,
) -> Result<f64>{
let scalar_value = get_scalar_value(expr).map_err(|_e| {
so is this about fixing line 33 here to potentially accept a ColumnarValue::Array with length 1? Since for some reason its not coming as a ColumnarValue::Scalar?
Activity
dd-annarose commentedon Aug 13, 2026
take
Jefffrey commentedon Aug 20, 2026
what would be the behaviour if it supports
ColumnarValue::Arrayfor the percentile? or is this assuming the array is len 1 anyway, akin to a scalar?dd-annarose commentedon Sep 11, 2026
@Jefffrey We're hitting an issue when the percentile comes from a projection. The behavior would be the same as for Trino: the percentile argument must be constant for all inputs. So yes, essentially it would be a ScalarValue (not always folded into a ScalarValue).
does that seem reasonable to you?
Jefffrey commentedon Sep 15, 2026
datafusion/datafusion/functions-aggregate/src/utils.rs
Lines 30 to 48 in 04ca5ac
so is this about fixing line 33 here to potentially accept a
ColumnarValue::Arraywith length 1? Since for some reason its not coming as aColumnarValue::Scalar?dd-annarose commentedon Sep 15, 2026
@Jefffrey Not exactly: this is not sufficient because you can have empty batches and then would not be able to resolve the percentile argument.
feat: support col reference for percentiles (apache#25337)
feat: support col reference for percentiles (apache#25337)