Commit 90d7433
committed
Return NaN instead of null for mean of all-null input
Mean::finalize_scalar returned null when count was zero, while the array
finalize path computes sum/count = 0/0 = NaN for the same input. The
result of a mean over an all-null group therefore depended on which
reduce path it took. Nulls are skipped during accumulation, so an
all-null input is an empty mean: let the division produce NaN in both
paths.
Signed-off-by: Dimitar Dimitrov <dimitar@spiraldb.com>1 parent eda4dd0 commit 90d7433
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
233 | | - | |
| 235 | + | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
237 | | - | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
0 commit comments