Opened 5 years ago

Closed 5 years ago

#30665 closed New feature (fixed)

Add DISTINCT support for Avg and Sum aggregates.

Reported by: Étienne Beaulé Owned by: Étienne Beaulé
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As an extension of #28658, aggregates should be supported for other general aggregates such as Avg and Sum. Before 2.2, these aggregations just ignored the parameter, but now throw an exception.

This change would just involve setting these classes as allowing DISTINCT, and could also be applied to Min and Max (although pointless).

Change History (6)

comment:1 by Étienne Beaulé, 5 years ago

Has patch: set
Owner: changed from Étienne Beaulé to Étienne Beaulé

comment:2 by Mariusz Felisiak, 5 years ago

Summary: Add DISTINCT handling for widely-supported aggregatesAdd DISTINCT support for Avg and Sum aggregates.
Triage Stage: UnreviewedAccepted
Version: 2.2master

comment:3 by Étienne Beaulé, 5 years ago

Summary: Add DISTINCT support for Avg and Sum aggregates.Add DISTINCT support for Avg, Sum, StdDev, and Variance aggregates.

Must disagree, felixxm. Neither StdDev nor Variance is in scope for this task as using the DISTINCT keyword on these aggregates is not as widely supported by SQL backends (such as Oracle). Supporting these would require more involved work. Some discussion was had about using check_expression_support() in GH9174 but was dropped.

(Did you revert yourself? I didn't mean to change the summary back...)

Last edited 5 years ago by Étienne Beaulé (previous) (diff)

comment:4 by Étienne Beaulé, 5 years ago

Summary: Add DISTINCT support for Avg, Sum, StdDev, and Variance aggregates.Add DISTINCT support for Avg and Sum aggregates.

comment:5 by Mariusz Felisiak, 5 years ago

Yes :) I checked this more carefully and reverted title change.

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 5f24e715:

Fixed #30665 -- Added support for distinct argument to Avg() and Sum().

Note: See TracTickets for help on using tickets.
Back to Top