Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

The DistinctMedianAccumulator::evaluate() method was using std::mem::take() which consumed the internal state, causing subsequent calls to return incorrect results. This was the last remaining item from #19612

What changes are included in this PR?

  1. Changed DistinctMedianAccumulator::evaluate() to use .iter() instead of std::mem::take() to preserve internal state across multiple calls
  2. Added sqllogictest case for distinct median with window frames

Are these changes tested?

Yes, added a sqllogictest

Are there any user-facing changes?

No

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accumulators which don't implement retract_batch can still exhibit buggy behaviour

2 participants