Skip to content

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

Merged
andygrove merged 4 commits into
apache:masterfrom
andygrove:grouping-agg
May 10, 2022
Merged

Add SQL planner support for grouping() aggregate expressions#2486
andygrove merged 4 commits into
apache:masterfrom
andygrove:grouping-agg

Conversation

@andygrove

@andygroveandygrove commented May 8, 2022

Copy link
Copy Markdown
Member

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

@andygroveandygrove self-assigned this May 8, 2022
@andygrove
andygrove marked this pull request as draft May 8, 2022 15:51
@andygroveandygrove changed the title WIP: Add SQL planner support for grouping() aggregate expressionsAdd SQL planner support for grouping() aggregate expressionsMay 9, 2022
@andygrove
andygrove marked this pull request as ready for review May 9, 2022 23:09
@andygrove
andygrove requested review from alamb and jimexistMay 9, 2022 23:53

@alambalamb left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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

@andygrove@alamb