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

Add SQL planner support for grouping() aggregate expressions #2486

Merged
merged 4 commits into from
May 10, 2022

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented May 8, 2022

Which issue does this PR close?

Closes #2477

Rationale for this change

Add support for planning SQL queries containing grouping() aggregate expressions

What changes are included in this PR?

Add support for planning SQL queries containing grouping() aggregate expressions

Are there any user-facing changes?

No

@andygrove andygrove self-assigned this May 8, 2022
@github-actions github-actions bot added the datafusion Changes in the datafusion crate label May 8, 2022
@andygrove andygrove marked this pull request as draft May 8, 2022 15:51
@andygrove andygrove changed the title WIP: Add SQL planner support for grouping() aggregate expressions Add SQL planner support for grouping() aggregate expressions May 9, 2022
@andygrove andygrove marked this pull request as ready for review May 9, 2022 23:09
@andygrove andygrove requested review from alamb and jimexist May 9, 2022 23:53
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

fn create_accumulator(&self) -> Result<Box<dyn Accumulator>> {
Err(DataFusionError::NotImplemented(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
I see -- I was going to suggest adding a test to sql_integ but it isn't ready yet 👍

@andygrove
Copy link
Member Author

TIL "GROUPING" exploding_head

https://www.postgresql.org/docs/9.5/functions-aggregate.html (Table 9-53. Grouping Operations) and https://docs.microsoft.com/en-us/sql/t-sql/functions/grouping-transact-sql?view=sql-server-ver15

I hadn't seen this before either, but it is used in the TPC-DS benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for grouping aggregate function in the SQL planner
2 participants