diff --git a/be/src/pipeline/exec/aggregation_sink_operator.cpp b/be/src/pipeline/exec/aggregation_sink_operator.cpp index aa21449a5c92193..d79623ba4c3130f 100644 --- a/be/src/pipeline/exec/aggregation_sink_operator.cpp +++ b/be/src/pipeline/exec/aggregation_sink_operator.cpp @@ -347,8 +347,7 @@ Status AggSinkLocalState::_merge_with_serialized_key_helper(vectorized::Block* b _places.data(), Base::_parent->template cast() ._offsets_of_aggregate_states[i], - _deserialize_buffer.data(), - (vectorized::ColumnString*)(column.get()), _agg_arena_pool, + _deserialize_buffer.data(), column.get(), _agg_arena_pool, rows); } } else { diff --git a/be/src/pipeline/exec/aggregation_source_operator.cpp b/be/src/pipeline/exec/aggregation_source_operator.cpp index d60ec1fad183c53..8545fe42f6829de 100644 --- a/be/src/pipeline/exec/aggregation_source_operator.cpp +++ b/be/src/pipeline/exec/aggregation_source_operator.cpp @@ -531,7 +531,7 @@ Status AggLocalState::merge_with_serialized_key_helper(vectorized::Block* block) SCOPED_TIMER(_deserialize_data_timer); Base::_shared_state->aggregate_evaluators[i]->function()->deserialize_and_merge_vec( _places.data(), _shared_state->offsets_of_aggregate_states[i], - _deserialize_buffer.data(), (vectorized::ColumnString*)(column.get()), + _deserialize_buffer.data(), column.get(), _shared_state->agg_arena_pool.get(), rows); } } diff --git a/be/src/pipeline/exec/streaming_aggregation_operator.cpp b/be/src/pipeline/exec/streaming_aggregation_operator.cpp index 0869845db8fcac7..bea67b3050a24a6 100644 --- a/be/src/pipeline/exec/streaming_aggregation_operator.cpp +++ b/be/src/pipeline/exec/streaming_aggregation_operator.cpp @@ -298,8 +298,7 @@ Status StreamingAggLocalState::_merge_with_serialized_key_helper(vectorized::Blo _places.data(), Base::_parent->template cast() ._offsets_of_aggregate_states[i], - _deserialize_buffer.data(), (vectorized::ColumnString*)(column.get()), - _agg_arena_pool.get(), rows); + _deserialize_buffer.data(), column.get(), _agg_arena_pool.get(), rows); } } else { RETURN_IF_ERROR(_aggregate_evaluators[i]->execute_batch_add( diff --git a/be/src/vec/aggregate_functions/aggregate_function.h b/be/src/vec/aggregate_functions/aggregate_function.h index 36dc6a91a347665..a8bf9a9324c241a 100644 --- a/be/src/vec/aggregate_functions/aggregate_function.h +++ b/be/src/vec/aggregate_functions/aggregate_function.h @@ -146,7 +146,7 @@ class IAggregateFunction { size_t num_rows) const = 0; virtual void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const = 0; virtual void deserialize_and_merge_vec_selected(const AggregateDataPtr* places, size_t offset, @@ -376,7 +376,7 @@ class IAggregateFunctionHelper : public IAggregateFunction { } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { const auto size_of_data = assert_cast(this)->size_of_data(); for (size_t i = 0; i != num_rows; ++i) { diff --git a/be/src/vec/aggregate_functions/aggregate_function_avg.h b/be/src/vec/aggregate_functions/aggregate_function_avg.h index 06c74d690ef9adf..13d6440b9643625 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_avg.h +++ b/be/src/vec/aggregate_functions/aggregate_function_avg.h @@ -244,7 +244,7 @@ class AggregateFunctionAvg final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { this->deserialize_from_column(rhs, *column, arena, num_rows); DEFER({ this->destroy_vec(rhs, num_rows); }); diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h index 354b8660bc1f660..dd7af71de06ae03 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h @@ -222,11 +222,11 @@ class AggregateFunctionBitmapSerializationHelper } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { if (version >= BITMAP_SERDE) { - auto& col = assert_cast(*assert_cast(column)); - auto* data = col.get_data().data(); + const auto& col = assert_cast(*column); + const auto* data = col.get_data().data(); for (size_t i = 0; i != num_rows; ++i) { this->data(places[i] + offset).merge(data[i]); } diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h b/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h index 33bc95296a43dc2..ce80b38d0913ba8 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h @@ -185,10 +185,10 @@ class AggregateFunctionBitmapAgg final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { - auto& col = assert_cast(*assert_cast(column)); - auto* data = col.get_data().data(); + const auto& col = assert_cast(*column); + const auto* data = col.get_data().data(); for (size_t i = 0; i != num_rows; ++i) { this->data(places[i] + offset).value |= data[i]; } diff --git a/be/src/vec/aggregate_functions/aggregate_function_collect.h b/be/src/vec/aggregate_functions/aggregate_function_collect.h index 7b3203bc9651ed8..4da6e023eb39496 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_collect.h +++ b/be/src/vec/aggregate_functions/aggregate_function_collect.h @@ -634,12 +634,11 @@ class AggregateFunctionCollect } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { if constexpr (ShowNull::value) { for (size_t i = 0; i != num_rows; ++i) { - this->data(places[i] + offset) - .deserialize_and_merge(*assert_cast(column), i); + this->data(places[i] + offset).deserialize_and_merge(*column, i); } } else { return BaseHelper::deserialize_and_merge_vec(places, offset, rhs, column, arena, diff --git a/be/src/vec/aggregate_functions/aggregate_function_count.h b/be/src/vec/aggregate_functions/aggregate_function_count.h index 08aa95168a2e67d..7449c949cb90471 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_count.h +++ b/be/src/vec/aggregate_functions/aggregate_function_count.h @@ -146,7 +146,7 @@ class AggregateFunctionCount final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { this->deserialize_from_column(rhs, *column, arena, num_rows); DEFER({ this->destroy_vec(rhs, num_rows); }); @@ -284,7 +284,7 @@ class AggregateFunctionCountNotNullUnary final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { this->deserialize_from_column(rhs, *column, arena, num_rows); DEFER({ this->destroy_vec(rhs, num_rows); }); diff --git a/be/src/vec/aggregate_functions/aggregate_function_map.h b/be/src/vec/aggregate_functions/aggregate_function_map.h index f2cbc9138905b1f..0f1a298aed10f3a 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_map.h +++ b/be/src/vec/aggregate_functions/aggregate_function_map.h @@ -300,9 +300,9 @@ class AggregateFunctionMapAgg final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { - auto& col = assert_cast(*assert_cast(column)); + const auto& col = assert_cast(*column); for (size_t i = 0; i != num_rows; ++i) { auto map = doris::vectorized::get(col[i]); this->data(places[i] + offset).add(map[0], map[1]); diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max.h b/be/src/vec/aggregate_functions/aggregate_function_min_max.h index e6476a0621a95ea..0d724e7ee5f45ea 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_max.h +++ b/be/src/vec/aggregate_functions/aggregate_function_min_max.h @@ -624,7 +624,7 @@ class AggregateFunctionsSingleValue final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { this->deserialize_from_column(rhs, *column, arena, num_rows); DEFER({ this->destroy_vec(rhs, num_rows); }); diff --git a/be/src/vec/aggregate_functions/aggregate_function_sum.h b/be/src/vec/aggregate_functions/aggregate_function_sum.h index ecdf010c8178978..376b6ece4aafea0 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sum.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sum.h @@ -183,7 +183,7 @@ class AggregateFunctionSum final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { this->deserialize_from_column(rhs, *column, arena, num_rows); DEFER({ this->destroy_vec(rhs, num_rows); }); diff --git a/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h b/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h index 83bf1e494239811..3eaa6418f0b7ca6 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h +++ b/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h @@ -215,7 +215,7 @@ class AggregateFunctionUniqDistributeKey final } void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t offset, - AggregateDataPtr rhs, const ColumnString* column, Arena* arena, + AggregateDataPtr rhs, const IColumn* column, Arena* arena, const size_t num_rows) const override { this->deserialize_from_column(rhs, *column, arena, num_rows); DEFER({ this->destroy_vec(rhs, num_rows); }); diff --git a/be/src/vec/exec/vaggregation_node.h b/be/src/vec/exec/vaggregation_node.h index 7bb3c9848d3e198..16ebeacceb5d090 100644 --- a/be/src/vec/exec/vaggregation_node.h +++ b/be/src/vec/exec/vaggregation_node.h @@ -673,8 +673,8 @@ class AggregationNode : public ::doris::ExecNode { SCOPED_TIMER(_deserialize_data_timer); _aggregate_evaluators[i]->function()->deserialize_and_merge_vec( _places.data(), _offsets_of_aggregate_states[i], - _deserialize_buffer.data(), (ColumnString*)(column.get()), - _agg_arena_pool.get(), rows); + _deserialize_buffer.data(), column.get(), _agg_arena_pool.get(), + rows); } } else { RETURN_IF_ERROR(_aggregate_evaluators[i]->execute_batch_add(