-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
See following functions:
datafusion/datafusion/functions-aggregate/src/percentile_cont.rs
Lines 70 to 72 in eef1c9e
| /// Computes the exact percentile continuous of a set of numbers | |
| pub fn percentile_cont(order_by: Sort, percentile: Expr) -> Expr { | |
| let expr = order_by.expr.clone(); |
| /// Computes the approximate percentile continuous of a set of numbers | |
| pub fn approx_percentile_cont( | |
| order_by: Sort, | |
| percentile: Expr, | |
| centroids: Option<Expr>, | |
| ) -> Expr { | |
| let expr = order_by.expr.clone(); |
datafusion/datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs
Lines 46 to 53 in eef1c9e
| /// Computes the approximate percentile continuous with weight of a set of numbers | |
| pub fn approx_percentile_cont_with_weight( | |
| order_by: Sort, | |
| weight: Expr, | |
| percentile: Expr, | |
| centroids: Option<Expr>, | |
| ) -> Expr { | |
| let expr = order_by.expr.clone(); |
Issues are they accept a Sort which extracts the expression to calculate for, however this allows specifying null_order which is meaningless as they will always ignore nulls in their calculations.
Describe the solution you'd like
Consider refactoring to something like:
pub fn percentile_cont(expr: Expr, percentile: Expr, asc: bool) -> ExprDescribe alternatives you've considered
Don't do this
Additional context
See: #17805 (comment)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request