Skip to content

Commit

Permalink
fix(query): fix double panic if enable_experimental_aggregate_hashtab…
Browse files Browse the repository at this point in the history
…le (#14576)

* fix(query): fix double panic if enable_experimental_aggregate_hashtable

* fix(query): fix double panic if enable_experimental_aggregate_hashtable
  • Loading branch information
zhang2014 authored Feb 3, 2024
1 parent ba033c2 commit 9323427
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@ impl<Method: HashMethodBounds> AccumulatingTransform for TransformPartialAggrega
Ok(vec![])
}

fn on_finish(&mut self, _output: bool) -> Result<Vec<DataBlock>> {
fn on_finish(&mut self, output: bool) -> Result<Vec<DataBlock>> {
Ok(match std::mem::take(&mut self.hash_table) {
HashTable::MovedOut => unreachable!(),
HashTable::MovedOut => match !output && std::thread::panicking() {
true => vec![],
false => unreachable!(),
},
HashTable::HashTable(v) => match v.hashtable.len() == 0 {
true => vec![],
false => vec![DataBlock::empty_with_meta(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ impl<Method: HashMethodBounds> AccumulatingTransform for TransformPartialGroupBy
Ok(vec![])
}

fn on_finish(&mut self, _output: bool) -> Result<Vec<DataBlock>> {
fn on_finish(&mut self, output: bool) -> Result<Vec<DataBlock>> {
Ok(match std::mem::take(&mut self.hash_table) {
HashTable::MovedOut => unreachable!(),
HashTable::MovedOut => match !output && std::thread::panicking() {
true => vec![],
false => unreachable!(),
},
HashTable::HashTable(cell) => match cell.hashtable.len() == 0 {
true => vec![],
false => vec![DataBlock::empty_with_meta(
Expand Down

0 comments on commit 9323427

Please sign in to comment.