Skip to content

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
@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

None yet

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