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); }