From c7bef62c0294f588d801e9fb59cfe3fbfe9a4032 Mon Sep 17 00:00:00 2001 From: Pxl Date: Thu, 29 May 2025 20:37:53 +0800 Subject: [PATCH] [enhancement](memoryfailed) throw exception if block.serialize meet error status (#51335) throw exception if block.serialize meet error status --- be/src/vec/aggregate_functions/aggregate_function_sort.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/be/src/vec/aggregate_functions/aggregate_function_sort.h b/be/src/vec/aggregate_functions/aggregate_function_sort.h index 466aa15786a258..337642ece256a0 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sort.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sort.h @@ -75,9 +75,11 @@ struct AggregateFunctionSortData { PBlock pblock; size_t uncompressed_bytes = 0; size_t compressed_bytes = 0; - static_cast(block.serialize(state->be_exec_version(), &pblock, &uncompressed_bytes, - &compressed_bytes, - segment_v2::CompressionTypePB::NO_COMPRESSION)); + auto st = block.serialize(state->be_exec_version(), &pblock, &uncompressed_bytes, + &compressed_bytes, segment_v2::CompressionTypePB::NO_COMPRESSION); + if (!st.ok()) { + throw doris::Exception(st); + } write_string_binary(pblock.SerializeAsString(), buf); }