-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(accumulators): preserve state in evaluate() for window frame queries #19618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
af2e94f
c5fe87b
86e4e03
3d4eeee
3b1e671
f198c2a
a73d509
44fc8f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,14 +384,13 @@ impl Accumulator for SimpleStringAggAccumulator { | |
| } | ||
|
|
||
| fn evaluate(&mut self) -> Result<ScalarValue> { | ||
| let result = if self.has_value { | ||
| ScalarValue::LargeUtf8(Some(std::mem::take(&mut self.accumulated_string))) | ||
| if self.has_value { | ||
| Ok(ScalarValue::LargeUtf8(Some( | ||
| self.accumulated_string.clone(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is unavoidable 🙁 I might need to think on this a bit to see if there are ways around requiring this clone 🤔
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this approach is fine for now |
||
| ))) | ||
| } else { | ||
| ScalarValue::LargeUtf8(None) | ||
| }; | ||
|
|
||
| self.has_value = false; | ||
| Ok(result) | ||
| Ok(ScalarValue::LargeUtf8(None)) | ||
| } | ||
| } | ||
|
|
||
| fn size(&self) -> usize { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own reference (and anyone else reviewing), this is the same code as from median:
retract_batch#19278