From 844dd8b2cec9514d5f609cd5a8fd6967ccd03e59 Mon Sep 17 00:00:00 2001 From: Jerry Hu Date: Thu, 21 Mar 2024 13:45:36 +0800 Subject: [PATCH] [fix](spill) should wait for merging done before read agg result (#32537) --- .../exec/partitioned_aggregation_source_operator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/be/src/pipeline/exec/partitioned_aggregation_source_operator.cpp b/be/src/pipeline/exec/partitioned_aggregation_source_operator.cpp index 909de78478..82bb25e674 100644 --- a/be/src/pipeline/exec/partitioned_aggregation_source_operator.cpp +++ b/be/src/pipeline/exec/partitioned_aggregation_source_operator.cpp @@ -132,6 +132,12 @@ Status PartitionedAggSourceOperatorX::get_block(RuntimeState* state, vectorized: RETURN_IF_ERROR(local_state._status); RETURN_IF_ERROR(local_state.initiate_merge_spill_partition_agg_data(state)); + + /// When `_is_merging` is true means we are reading spilled data and merging the data into hash table. + if (local_state._is_merging) { + return Status::OK(); + } + auto* runtime_state = local_state._runtime_state.get(); RETURN_IF_ERROR(_agg_source_operator->get_block(runtime_state, block, eos)); if (local_state._runtime_state) {