Implementation of distinctBy for DurationSumFilter/-Select#3839
Implementation of distinctBy for DurationSumFilter/-Select#3839awildturtok wants to merge 2 commits intodevelopfrom
Conversation
| @Valid | ||
| @NotNull | ||
| private ColumnId column; | ||
|
|
||
| @Valid | ||
| @Nullable | ||
| private List<ColumnId> distinctBy; |
There was a problem hiding this comment.
können wir die final machen ?
| @Override | ||
| @Valid | ||
| @NotNull | ||
| private ColumnId column; |
There was a problem hiding this comment.
| private ColumnId column; | |
| private ColumnId dateRangeColumn; |
| if (distinctBy != null) { | ||
| aggregator = new DistinctValuesWrapperAggregator<>(aggregator, distinctBy.stream().map(ColumnId::resolve).toList()); | ||
| } |
There was a problem hiding this comment.
Was passiert in dem Fall wenn distinctBy = []
There was a problem hiding this comment.
habs abgefangen, guter Punkt das ist natürlich quatsch
|
|
||
| @Override | ||
| public SelectConverter<DurationSumSelect> createConverter() { | ||
| //TODO apply distinctBy (though needs to be done once other branches |
There was a problem hiding this comment.
Hier ist noch ein TODO und es ist abgeschnitten
There was a problem hiding this comment.
Ups, aber der Todo reisst es schon an, es hängt von einem anderen PR ab. Die aktuelle implementierung von DurationSum ist falsch.
| result,dates,concept select | ||
| 1,{2010-01-01/2010-01-01},1 | ||
| 3,{2010-01-01/2010-01-01}, | ||
| 4,{2010-01-01/2010-01-02},1 | ||
| 5,{2010-01-01/2010-01-02},2 | ||
| 6,{-∞/2010-01-01}, No newline at end of file |
There was a problem hiding this comment.
Wow das sieht irgendwie gefährlich und unintuitiv aus. Das Ergebnis hängt von der Sortierung der Zeilen ab 👀
There was a problem hiding this comment.
Naja, es geht am Ende nicht anders. Es geht ja darum, dass bestimmte Rezepte oä nur einmal gezählt werden. Aber ist definitiv wert in der Doku zu erwähnen, guter Punkt.
No description provided.