TangSiyang2001 commented on code in PR #15339: URL: https://github.com/apache/doris/pull/15339#discussion_r1108009442
########## be/src/vec/aggregate_functions/aggregate_function_collect.h: ########## @@ -177,21 +243,31 @@ struct AggregateFunctionCollectListData<StringRef> { void insert_result_into(IColumn& to) const { auto& to_str = assert_cast<ColVecType&>(to); - to_str.insert_range_from(*data, 0, data->size()); + to_str.insert_range_from(*data, 0, size()); } }; -template <typename Data> -class AggregateFunctionCollect final - : public IAggregateFunctionDataHelper<Data, AggregateFunctionCollect<Data>> { -public: - static constexpr bool alloc_memory_in_arena = - std::is_same_v<Data, AggregateFunctionCollectSetData<StringRef>>; +template <typename Data, typename HasLimit> +class AggregateFunctionCollect + : public IAggregateFunctionDataHelper<Data, AggregateFunctionCollect<Data, HasLimit>> { + using GenericType = AggregateFunctionCollectSetData<StringRef>; + + static constexpr bool HAS_LIMIT = HasLimit::value; + static constexpr bool ENABLE_ARENA = std::is_same_v<Data, GenericType>; - AggregateFunctionCollect(const DataTypes& argument_types_) - : IAggregateFunctionDataHelper<Data, AggregateFunctionCollect<Data>>(argument_types_, - {}), - _argument_type(argument_types_[0]) {} +public: + AggregateFunctionCollect(const DataTypePtr& argument_type, const Array& parameters_, + UInt64 max_size_ = std::numeric_limits<UInt64>::max()) + : IAggregateFunctionDataHelper<Data, AggregateFunctionCollect<Data, HasLimit>>( + {argument_type}, parameters_), + return_type(argument_type) {} + + AggregateFunctionCollect(const DataTypePtr& argument_type, const Array& parameters_, Review Comment: Redundance result of migrating from the original code, I'll rm it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org