Commit 7c2eb98
fix(query-engine): merge all sliding-window buckets per key instead of taking first (#570)
* fix(query-engine): merge all sliding-window buckets per key instead of taking first
execute_and_merge_store_queries kept only the first precomputed bucket
per key for Sliding-window queries, discarding the rest when the store
returned more than expected. DataFusion's SummaryMergeMultipleExec
already merges all of them correctly, so binary-expr queries (still on
DataFusion) don't hit this. #567 will move binary-expr onto this native
path, so this native/DataFusion behavior gap needed closing first.
Part of #567 Stage 1.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(query-engine): dedupe sliding-window merge path, fix double-clone and stale latency label
- Sliding branch now delegates to merge_precomputed_outputs (do_merge=true)
instead of hand-rolling its own extract/merge/insert loop, removing the
duplication with the Tumbling branch's merge path.
- merge_accumulators now takes ownership of the accumulator Vec so its
single-element shortcut can move the value out instead of re-cloning it
on top of the clone already done to build the Vec.
- The [LATENCY] log's merge/no-merge label was hardcoded off window_type
and said "no merge" even when merge_accumulators was in fact called;
it now reflects whether merging actually occurs.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(query-engine): warn instead of silently dropping keys with no precompute buckets
merge_precomputed_outputs silently skipped any key whose timestamped_buckets
list was empty, with no log signal — unlike the "found N, expected 1"
mismatch case a few lines up in the Sliding caller, which does warn. Since
this function is shared by Sliding, Tumbling, and the keys-merge path, the
warn now covers all three instead of being Sliding-only.
Also files #575 to compute EXPECTED_BUCKETS_PER_KEY instead of hardcoding it
to 1, since #554 will make >1 legitimate whenever a sliding-window query's
range exceeds the window size.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 808e09d commit 7c2eb98
3 files changed
Lines changed: 213 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
568 | 575 | | |
569 | 576 | | |
570 | 577 | | |
| |||
576 | 583 | | |
577 | 584 | | |
578 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
579 | 589 | | |
580 | 590 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
| 591 | + | |
586 | 592 | | |
587 | 593 | | |
588 | 594 | | |
| |||
1068 | 1074 | | |
1069 | 1075 | | |
1070 | 1076 | | |
1071 | | - | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1072 | 1083 | | |
1073 | 1084 | | |
1074 | 1085 | | |
| |||
1080 | 1091 | | |
1081 | 1092 | | |
1082 | 1093 | | |
1083 | | - | |
| 1094 | + | |
1084 | 1095 | | |
1085 | 1096 | | |
1086 | 1097 | | |
| |||
1123 | 1134 | | |
1124 | 1135 | | |
1125 | 1136 | | |
1126 | | - | |
| 1137 | + | |
1127 | 1138 | | |
1128 | 1139 | | |
1129 | 1140 | | |
1130 | 1141 | | |
1131 | 1142 | | |
1132 | 1143 | | |
1133 | | - | |
| 1144 | + | |
1134 | 1145 | | |
1135 | 1146 | | |
1136 | 1147 | | |
1137 | 1148 | | |
1138 | 1149 | | |
1139 | 1150 | | |
1140 | | - | |
| 1151 | + | |
1141 | 1152 | | |
1142 | 1153 | | |
1143 | 1154 | | |
| |||
1153 | 1164 | | |
1154 | 1165 | | |
1155 | 1166 | | |
1156 | | - | |
| 1167 | + | |
1157 | 1168 | | |
1158 | 1169 | | |
1159 | 1170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
Lines changed: 174 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 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 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
0 commit comments