This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 14221adbbd [fix](agg) crash caused by failure of prepare (#12437)
14221adbbd is described below

commit 14221adbbd931a84cf6c9707589927d557fc835b
Author: Jerry Hu <mrh...@gmail.com>
AuthorDate: Thu Sep 8 15:03:45 2022 +0800

    [fix](agg) crash caused by failure of prepare (#12437)
---
 be/src/vec/exec/vaggregation_node.cpp | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/be/src/vec/exec/vaggregation_node.cpp 
b/be/src/vec/exec/vaggregation_node.cpp
index b8a3705c96..71f06deb24 100644
--- a/be/src/vec/exec/vaggregation_node.cpp
+++ b/be/src/vec/exec/vaggregation_node.cpp
@@ -90,7 +90,16 @@ AggregationNode::AggregationNode(ObjectPool* pool, const 
TPlanNode& tnode,
           _build_timer(nullptr),
           _serialize_key_timer(nullptr),
           _exec_timer(nullptr),
-          _merge_timer(nullptr) {
+          _merge_timer(nullptr),
+          _expr_timer(nullptr),
+          _get_results_timer(nullptr),
+          _serialize_data_timer(nullptr),
+          _serialize_result_timer(nullptr),
+          _deserialize_data_timer(nullptr),
+          _hash_table_compute_timer(nullptr),
+          _streaming_agg_timer(nullptr),
+          _hash_table_size_counter(nullptr),
+          _hash_table_input_counter(nullptr) {
     if (tnode.agg_node.__isset.use_streaming_preaggregation) {
         _is_streaming_preagg = tnode.agg_node.use_streaming_preaggregation;
         if (_is_streaming_preagg) {
@@ -499,11 +508,14 @@ Status AggregationNode::close(RuntimeState* state) {
     VExpr::close(_probe_expr_ctxs, state);
     if (_executor.close) _executor.close();
 
-    std::visit(
-            [&](auto&& agg_method) {
-                COUNTER_SET(_hash_table_size_counter, 
int64_t(agg_method.data.size()));
-            },
-            _agg_data._aggregated_method_variant);
+    /// _hash_table_size_counter may be null if prepare failed.
+    if (_hash_table_size_counter) {
+        std::visit(
+                [&](auto&& agg_method) {
+                    COUNTER_SET(_hash_table_size_counter, 
int64_t(agg_method.data.size()));
+                },
+                _agg_data._aggregated_method_variant);
+    }
 
     return ExecNode::close(state);
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to