Commit 958596b
committed
fix(adapter): exclude end-day row from daily route for inclusive-midnight upper bounds
Daily MV rows live at toStartOfDay(time). An inclusive `time <= midnight`
predicate matched the row at that midnight, which represents the entire
day starting at it — so callers received totals that over-included the
end day's data.
Two changes:
- routedSum() translates inclusive `LESSER_EQUAL` time bounds at midnight
to exclusive `LESSER` before delegating to sumDaily(). BETWEEN with an
inclusive midnight upper is split into a `>=` lower + `<` upper pair.
- buildDailyTimeFilters() (hybrid path) applies the same translation
when emitting the daily-branch WHERE clause.
Bench bounds in EventsBench were also relying on current time-of-day,
which prevented bench_events_sum_30d from satisfying the day-aligned
check and routed it to raw despite the route assertion expecting daily.
Floored to UTC midnight so the scenario exercises the path it asserts.
Regression test: seeds an event mid-day on the end day, queries with
inclusive-midnight upper, asserts the daily-routed sum equals the raw
sum (and does not include the late event).1 parent 30073c3 commit 958596b
3 files changed
Lines changed: 89 additions & 5 deletions
File tree
- src/Usage/Adapter
- tests
- Benchmark
- Usage/Adapter
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2155 | 2155 | | |
2156 | 2156 | | |
2157 | 2157 | | |
2158 | | - | |
| 2158 | + | |
2159 | 2159 | | |
2160 | 2160 | | |
2161 | 2161 | | |
| |||
2334 | 2334 | | |
2335 | 2335 | | |
2336 | 2336 | | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
2337 | 2395 | | |
2338 | 2396 | | |
2339 | 2397 | | |
| |||
2550 | 2608 | | |
2551 | 2609 | | |
2552 | 2610 | | |
2553 | | - | |
| 2611 | + | |
| 2612 | + | |
2554 | 2613 | | |
2555 | 2614 | | |
2556 | 2615 | | |
| |||
2566 | 2625 | | |
2567 | 2626 | | |
2568 | 2627 | | |
2569 | | - | |
| 2628 | + | |
| 2629 | + | |
2570 | 2630 | | |
2571 | 2631 | | |
2572 | 2632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
89 | 113 | | |
90 | 114 | | |
91 | 115 | | |
| |||
0 commit comments