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 , 5 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
comment:2 by , 5 years ago
Summary: | Add DISTINCT handling for widely-supported aggregates → Add DISTINCT support for Avg and Sum aggregates. |
---|---|
Triage Stage: | Unreviewed → Accepted |
Version: | 2.2 → master |
comment:3 by , 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.
comment:4 by , 5 years ago
Summary: | Add DISTINCT support for Avg, Sum, StdDev, and Variance aggregates. → Add DISTINCT support for Avg and Sum aggregates. |
---|
PR