Skip to content
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

fix(query): double panic if broken state in block builder #17091

Merged
merged 5 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl<T: AccumulatingTransform + 'static> Drop for AccumulatingTransformer<T> {
fn drop(&mut self) {
drop_guard(move || {
if !self.called_on_finish {
self.called_on_finish = true;
self.inner.on_finish(false).unwrap();
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,6 @@ pub fn sort_merge(
for block in data_blocks {
processor.transform(block)?;
}

processor.on_finish(true)
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ impl AccumulatingTransform for BlockBuilder {
Ok(blocks)
}

fn on_finish(&mut self, _output: bool) -> Result<Vec<DataBlock>> {
self.flush_block(true)
fn on_finish(&mut self, output: bool) -> Result<Vec<DataBlock>> {
if output {
return self.flush_block(true);
}

Ok(vec![])
}
}
Loading