datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Support complete `distinct` usage for aggregate expressions

Open WinkerDu opened this issue 2 years ago • 2 comments

Is your feature request related to a problem or challenge? Please describe what you are trying to do. Here are multiple aggregate expressions have not support distinct usage yet. Though optimizer SingleDistinctToGroupBy (#1315) supports single distinct usage, there are more SQL scenes have not been covered, like

SELECT AVG(c1), SUM(DISTINCT c2) FROM test

I would like to take effort to work on the following tickets to complete distinct usage for aggregate expressions

  • [x] #2405
  • [ ] #2407
  • [ ] #2408
  • [ ] #2409
  • [ ] #2410
  • [x] #2411 (more to be added later)

Describe the solution you'd like Adds specific aggregate expression support, like expressions::DistinctSum for sum(distinct)

Describe alternatives you've considered No.

Additional context No.

WinkerDu avatar May 02 '22 10:05 WinkerDu

@andygrove @alamb can you please assign this issue to me? Thank you ❤️

WinkerDu avatar May 02 '22 11:05 WinkerDu

@andygrove @alamb can you please assign this issue to me? Thank you ❤️

Done -- thanks @WinkerDu

alamb avatar May 02 '22 17:05 alamb