Skip to content

Epic: Ordered Set Aggregate Functions #12824

@jayzhan211

Description

@jayzhan211

Is your feature request related to a problem or challenge?

DataFusion doesn't support ordered-set aggregate functions yet.

Those functions are supported in Postgres, DuckDB, so I think we should support them in this repo as the core functions

Screenshot 2024-10-09 at 8 49 19 AM

All the aggregates listed in Table 9-51 ignore null values in their sorted input. For those that take a fraction parameter, the fraction value must be between 0 and 1; an error is thrown if not. However, a null fraction value simply produces a null result.

Related PR, #11732.

We have approx_percentile_cont and approx_percentile_cont_with_weight already, maybe we can start from these two functions

  • approx_percentile_cont(fraction) WITHIN GROUP (ORDER BY sort_expression)
  • approx_percentile_cont_with_weight(fraction) WITHIN GROUP (ORDER BY sort_expression)

Tasks to do

Metadata

Metadata

Assignees

No one assigned

    Labels

    PROPOSAL EPICA proposal being discussed that is not yet fully underwayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions