From 4733a9f8e6ccf8f7e52f83e00741b80c28fccab7 Mon Sep 17 00:00:00 2001 From: hezuojiao Date: Mon, 17 Jun 2024 18:55:14 +0000 Subject: [PATCH] [CP] Fix merge groupby memory usage when processor has extra --- src/sql/engine/aggregate/ob_aggregate_processor.h | 1 + src/sql/engine/aggregate/ob_merge_groupby_op.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sql/engine/aggregate/ob_aggregate_processor.h b/src/sql/engine/aggregate/ob_aggregate_processor.h index f994f2ebc4..ea22713b02 100644 --- a/src/sql/engine/aggregate/ob_aggregate_processor.h +++ b/src/sql/engine/aggregate/ob_aggregate_processor.h @@ -693,6 +693,7 @@ public: } inline void set_in_window_func() { in_window_func_ = true; } inline bool has_distinct() const { return has_distinct_; } + inline bool has_extra() const { return has_extra_; } inline bool has_order_by() const { return has_order_by_; } RemovalInfo &get_removal_info() { return removal_info_; } diff --git a/src/sql/engine/aggregate/ob_merge_groupby_op.cpp b/src/sql/engine/aggregate/ob_merge_groupby_op.cpp index b76b2ffe15..3df96d4b0a 100644 --- a/src/sql/engine/aggregate/ob_merge_groupby_op.cpp +++ b/src/sql/engine/aggregate/ob_merge_groupby_op.cpp @@ -270,7 +270,7 @@ int ObMergeGroupByOp::init() } LOG_DEBUG("debug distinct exprs", K(ret), K(MY_SPEC.distinct_exprs_.count())); } - if (OB_SUCC(ret) && aggr_processor_.has_distinct()) { + if (OB_SUCC(ret) && aggr_processor_.has_extra()) { // set group_batch_factor_ to 1 avoid out of memory error group_batch_factor_ = 1; }