Skip to content
Open
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
37 changes: 26 additions & 11 deletions be/src/pipeline/exec/streaming_aggregation_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ Status StreamingAggLocalState::init(RuntimeState* state, LocalStateInfo& info) {
_merge_timer = ADD_TIMER(Base::custom_profile(), "MergeTime");
_expr_timer = ADD_TIMER(Base::custom_profile(), "ExprTime");
_insert_values_to_column_timer = ADD_TIMER(Base::custom_profile(), "InsertValuesToColumnTime");
_streaming_agg_serialize_to_column =
ADD_TIMER(Base::custom_profile(), "StreamingAggSerializeToColumnTime");
_serialize_to_column = ADD_TIMER(Base::custom_profile(), "SerializeToColumnTime");
_create_value_column_timer = ADD_TIMER(Base::custom_profile(), "CreateValueColumnTime");
_deserialize_data_timer = ADD_TIMER(Base::custom_profile(), "DeserializeAndMergeTime");
_hash_table_compute_timer = ADD_TIMER(Base::custom_profile(), "HashTableComputeTime");
_hash_table_emplace_timer = ADD_TIMER(Base::custom_profile(), "HashTableEmplaceTime");
Expand Down Expand Up @@ -382,6 +386,7 @@ Status StreamingAggLocalState::_pre_agg_with_serialized_key(doris::vectorized::B

for (int i = 0; i != _aggregate_evaluators.size(); ++i) {
SCOPED_TIMER(_insert_values_to_column_timer);
SCOPED_TIMER(_streaming_agg_serialize_to_column);
RETURN_IF_ERROR(_aggregate_evaluators[i]->streaming_agg_serialize_to_column(
in_block, value_columns[i], rows, _agg_arena_pool));
}
Expand Down Expand Up @@ -513,18 +518,28 @@ Status StreamingAggLocalState::_get_results_with_serialized_key(RuntimeState* st
for (size_t i = 0; i < _aggregate_evaluators.size(); ++i) {
value_data_types[i] =
_aggregate_evaluators[i]->function()->get_serialized_type();
if (mem_reuse) {
value_columns[i] =
std::move(*block->get_by_position(i + key_size).column)
.mutate();
} else {
value_columns[i] = _aggregate_evaluators[i]
->function()
->create_serialize_column();

{
SCOPED_TIMER(_create_value_column_timer);
// maybe it will copy data from block to value_columns,
if (mem_reuse) {
value_columns[i] =
std::move(*block->get_by_position(i + key_size)
.column)
.mutate();
} else {
value_columns[i] = _aggregate_evaluators[i]
->function()
->create_serialize_column();
}
}

{
SCOPED_TIMER(_serialize_to_column);
_aggregate_evaluators[i]->function()->serialize_to_column(
_values, p._offsets_of_aggregate_states[i],
value_columns[i], num_rows);
}
_aggregate_evaluators[i]->function()->serialize_to_column(
_values, p._offsets_of_aggregate_states[i],
value_columns[i], num_rows);
}
}
}},
Expand Down
3 changes: 3 additions & 0 deletions be/src/pipeline/exec/streaming_aggregation_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class StreamingAggLocalState MOCK_REMOVE(final) : public PipelineXLocalState<Fak
RuntimeProfile::Counter* _expr_timer = nullptr;
RuntimeProfile::Counter* _merge_timer = nullptr;
RuntimeProfile::Counter* _insert_values_to_column_timer = nullptr;
RuntimeProfile::Counter* _streaming_agg_serialize_to_column = nullptr;
RuntimeProfile::Counter* _serialize_to_column = nullptr;
RuntimeProfile::Counter* _create_value_column_timer = nullptr;
RuntimeProfile::Counter* _deserialize_data_timer = nullptr;
RuntimeProfile::Counter* _hash_table_memory_usage = nullptr;
RuntimeProfile::HighWaterMarkCounter* _serialize_key_arena_memory_usage = nullptr;
Expand Down