Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize APPROX_PERCENTILE_CONT / PERCENTILE_CONT and similar aggregation functions #11732

Open
Dandandan opened this issue Jul 30, 2024 · 3 comments · May be fixed by #13511
Open

Standardize APPROX_PERCENTILE_CONT / PERCENTILE_CONT and similar aggregation functions #11732

Dandandan opened this issue Jul 30, 2024 · 3 comments · May be fixed by #13511
Assignees
Labels
discussion Project Discussion enhancement New feature or request

Comments

@Dandandan
Copy link
Contributor

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

@Dandandan Dandandan added enhancement New feature or request discussion Project Discussion labels Jul 30, 2024
@samuelcolvin
Copy link
Contributor

See pydantic/logfire#433, support for WITHIN GROUP would be great.

@Garamda
Copy link

Garamda commented Oct 11, 2024

take
(cf. #12824)

@Garamda
Copy link

Garamda commented Nov 21, 2024

@Dandandan Would you assign this task to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Project Discussion enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants