Skip to content

Standardize APPROX_PERCENTILE_CONT / PERCENTILE_CONT and similar aggregation functions #11732

@Dandandan

Description

@Dandandan

Is your feature request related to a problem or challenge?

After https://github.com/apache/datafusion/pull/11721/files we handle nulls in APPROX_PERCENTILE_CONT by removing them before computing the percentile.
This is the default behaviour of PostgreSQL, Spark, etc.

However the syntax of the current aggregate functions is confusing for APPROX_PERCENTILE_CONT, as it supports IGNORE NULLS | RESPECT NULLS

Describe the solution you'd like

Come up with a plan to bring the syntax / semantics of APPROX_PERCENTILE_CONT and PERCENTILE_CONT and similar aggregations closer to PostgreSQL and others by (one or more).

  • Supporting something like PostgreSQL/Spark/Snowflake syntax: SELECT percentile_cont(<fraction double precision>) WITHIN GROUP (<sort_expression>)
  • Disabling specifying IGNORE NULLS | RESPECT NULLS for aggregations functions where they do not make sense / are not supported.
  • Comparing results against other engines

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions