yiguolei commented on code in PR #60367:
URL: https://github.com/apache/doris/pull/60367#discussion_r2772199968
##########
be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp:
##########
@@ -202,6 +204,26 @@ Status
DistinctStreamingAggLocalState::_distinct_pre_agg_with_serialized_key(
_emplace_into_hash_table_to_distinct(_distinct_row, key_columns, rows);
DCHECK_LE(_distinct_row.size(), rows)
<< "_distinct_row size should be less than or equal to rows";
+
+ size_t used_memory = 0;
+ std::visit(vectorized::Overload {
+ [&](std::monostate& arg) {
+ // Do nothing
+ },
+ [&](auto& agg_method) {
+ used_memory =
agg_method.hash_table->get_buffer_size_in_bytes();
+ }},
+ _agg_data->method_variant);
+ COUNTER_SET(_memory_used_counter,
+ int64_t(_distinct_row.allocated_bytes() + _arena.size() +
used_memory));
+ } else {
+ std::visit(vectorized::Overload {[&](std::monostate& arg) {
+ // Do nothing
+ },
+ [&](auto& agg_method) {
agg_method.hash_table.reset(); }},
+ _agg_data->method_variant);
+ _arena.clear(true);
Review Comment:
这里虽然要停止插入hashtable了,但是已经在hashtable 中的数据直接不管了吗?这里直接reset
这里会不会挂掉?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]