Skip to content

Commit

Permalink
Internal duckdb#215: QUANTILE Reuse Restriction
Browse files Browse the repository at this point in the history
Reduce the insert range of Reuse to the current frames
instead of the union of current and previous frames.
  • Loading branch information
Richard Wesley committed Sep 16, 2023
1 parent 955251b commit 596680d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core_functions/aggregate/holistic/quantile.cpp
Expand Up @@ -135,13 +135,13 @@ void ReuseIndexes(idx_t *index, const FrameBounds *currs, const FrameBounds *pre
// Insert new indices
if (j > 0) {
// Subframe indices
const auto union_start = MinValue(currs[0].start, prevs[0].start);
const auto union_end = MaxValue(currs[nframes - 1].end, prevs[nframes - 1].end);
const FrameBounds last(union_end, union_end);
const auto currs_start = currs[0].start;
const auto currs_end = currs[nframes - 1].end;
const FrameBounds last(currs_end, currs_end);

idx_t p = 0;
idx_t c = 0;
for (auto idx = union_start; idx < union_end;) {
for (auto idx = currs_start; idx < currs_end;) {
int overlap = 0;

// Are we in the previous frame?
Expand Down

0 comments on commit 596680d

Please sign in to comment.