Skip to content

Commit

Permalink
[BugFix] Fix chunk accumulator miss assign _max_size (backport #52579) (
Browse files Browse the repository at this point in the history
#52596)

Signed-off-by: stdpain <[email protected]>
Co-authored-by: stdpain <[email protected]>
  • Loading branch information
mergify[bot] and stdpain authored Dec 4, 2024
1 parent e1e55b9 commit c54b6ee
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Status SpillableAggregateBlockingSourceOperator::prepare(RuntimeState* state) {
RETURN_IF_ERROR(AggregateBlockingSourceOperator::prepare(state));
RETURN_IF_ERROR(_stream_aggregator->prepare(state, state->obj_pool(), _unique_metrics.get()));
RETURN_IF_ERROR(_stream_aggregator->open(state));
_accumulator.set_max_size(state->chunk_size());
return Status::OK();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Status SpillableAggregateDistinctBlockingSourceOperator::prepare(RuntimeState* s
RETURN_IF_ERROR(AggregateDistinctBlockingSourceOperator::prepare(state));
RETURN_IF_ERROR(_stream_aggregator->prepare(state, state->obj_pool(), _unique_metrics.get()));
RETURN_IF_ERROR(_stream_aggregator->open(state));
_accumulator.set_max_size(state->chunk_size());
return Status::OK();
}

Expand Down
1 change: 1 addition & 0 deletions be/src/exec/pipeline/hash_partition_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Status HashPartitionContext::prepare(RuntimeState* state, RuntimeProfile* profil
_has_nullable_key = _has_nullable_key || _partition_types[i].is_nullable;
}

_acc.set_max_size(state->chunk_size());
_chunks_partitioner = std::make_unique<ChunksPartitioner>(_has_nullable_key, _partition_exprs, _partition_types);
return _chunks_partitioner->prepare(state, profile);
}
Expand Down
2 changes: 1 addition & 1 deletion test/sql/test_spill/R/test_spill_aggregate
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ insert into t2 select sum(k1),k2 from t1 group by k2;
select * from t2;
-- result:
1 1
-- !result
-- !result
2 changes: 1 addition & 1 deletion test/sql/test_spill/T/test_spill_aggregate
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ DUPLICATE KEY(k1)
DISTRIBUTED BY HASH(k1) PROPERTIES('replication_num'='1');
insert into t1 values (1,"1");
insert into t2 select sum(k1),k2 from t1 group by k2;
select * from t2;
select * from t2;

0 comments on commit c54b6ee

Please sign in to comment.