diff --git a/be/src/vec/aggregate_functions/aggregate_function_sort.h b/be/src/vec/aggregate_functions/aggregate_function_sort.h index c025c42495cf1b..e7e50ded37815a 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sort.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sort.h @@ -90,7 +90,11 @@ struct AggregateFunctionSortData { PBlock pblock; pblock.ParseFromString(data); auto st = block.deserialize(pblock); - CHECK(st.ok()); + // If memory allocate failed during deserialize, st is not ok, throw exception here to + // stop the query. + if (!st.ok()) { + throw doris::Exception(st); + } } void add(const IColumn** columns, size_t columns_num, size_t row_num) { diff --git a/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h b/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h index efd51444c56560..781a621b15748d 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h +++ b/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h @@ -359,8 +359,10 @@ struct WindowFunnelState { } Block block; auto status = block.deserialize(pblock); + // If memory allocate failed during deserialize, st is not ok, throw exception here to + // stop the query. if (!status.ok()) { - throw doris::Exception(ErrorCode::INTERNAL_ERROR, status.to_string()); + throw doris::Exception(status); } mutable_block = MutableBlock(std::move(block)); _reset_columns_ptr();