Skip to content

Commit

Permalink
[BugFix] Fix spill group by limit hang (StarRocks#42583)
Browse files Browse the repository at this point in the history
Signed-off-by: stdpain <[email protected]>
  • Loading branch information
stdpain committed Apr 19, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 3e1cdd5 commit c6620c7
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -127,6 +127,7 @@ Status SpillableAggregateBlockingSinkOperator::reset_state(RuntimeState* state,
}

Status SpillableAggregateBlockingSinkOperator::_spill_all_inputs(RuntimeState* state, const ChunkPtr& chunk) {
RETURN_IF(_aggregator->hash_map_variant().size() == 0, Status::OK());
// spill all data
DCHECK(!_aggregator->is_none_group_by_exprs());
_aggregator->hash_map_variant().visit(
Original file line number Diff line number Diff line change
@@ -94,6 +94,7 @@ Status SpillableAggregateDistinctBlockingSinkOperator::push_chunk(RuntimeState*
}
RETURN_IF_ERROR(AggregateDistinctBlockingSinkOperator::push_chunk(state, chunk));
set_revocable_mem_bytes(_aggregator->hash_set_memory_usage());
if (_is_finished) return Status::OK();
if (_spill_strategy == spill::SpillStrategy::SPILL_ALL) {
return _spill_all_inputs(state, chunk);
}
@@ -110,6 +111,7 @@ Status SpillableAggregateDistinctBlockingSinkOperator::reset_state(RuntimeState*
}

Status SpillableAggregateDistinctBlockingSinkOperator::_spill_all_inputs(RuntimeState* state, const ChunkPtr& chunk) {
RETURN_IF(_aggregator->hash_set_variant().size() == 0, Status::OK());
_aggregator->hash_set_variant().visit(
[&](auto& hash_set_with_key) { _aggregator->it_hash() = hash_set_with_key->hash_set.begin(); });
CHECK(!_aggregator->spill_channel()->has_task());

0 comments on commit c6620c7

Please sign in to comment.