HappenLee commented on code in PR #16955:
URL: https://github.com/apache/doris/pull/16955#discussion_r1113763125


##########
be/src/vec/aggregate_functions/helpers.h:
##########
@@ -48,150 +55,145 @@ namespace doris::vectorized {
 
 /** Create an aggregate function with a numeric type in the template 
parameter, depending on the type of the argument.
   */
-template <template <typename> class AggregateFunctionTemplate, typename... 
TArgs>
-static IAggregateFunction* create_with_numeric_type(const IDataType& 
argument_type,
-                                                    TArgs&&... args) {
-    WhichDataType which(argument_type);
-#define DISPATCH(TYPE)                \
-    if (which.idx == TypeIndex::TYPE) \
-        return new 
AggregateFunctionTemplate<TYPE>(std::forward<TArgs>(args)...);
-    FOR_NUMERIC_TYPES(DISPATCH)
-#undef DISPATCH
-    return nullptr;
-}
-
-template <template <typename> class AggregateFunctionTemplate, typename... 
TArgs>
-static IAggregateFunction* create_with_numeric_type_null(const DataTypes& 
argument_types,
-                                                         TArgs&&... args) {
-    WhichDataType which(argument_types[0]);
-#define DISPATCH(TYPE)                                                         
             \
-    if (which.idx == TypeIndex::TYPE)                                          
             \
-        return new 
AggregateFunctionNullUnaryInline<AggregateFunctionTemplate<TYPE>, true>( \
-                new 
AggregateFunctionTemplate<TYPE>(std::forward<TArgs>(args)...),          \
-                argument_types);
-    FOR_NUMERIC_TYPES(DISPATCH)
-#undef DISPATCH
-    return nullptr;
-}
-
-template <template <typename, bool> class AggregateFunctionTemplate, bool 
bool_param,
-          typename... TArgs>
-static IAggregateFunction* create_with_numeric_type(const IDataType& 
argument_type,
-                                                    TArgs&&... args) {
-    WhichDataType which(argument_type);
-#define DISPATCH(TYPE)                \
-    if (which.idx == TypeIndex::TYPE) \
-        return new AggregateFunctionTemplate<TYPE, 
bool_param>(std::forward<TArgs>(args)...);
-    FOR_NUMERIC_TYPES(DISPATCH)
-#undef DISPATCH
-    return nullptr;
-}
-
-template <template <typename, typename> class AggregateFunctionTemplate, 
typename Data,
-          typename... TArgs>
-static IAggregateFunction* create_with_numeric_type(const IDataType& 
argument_type,
-                                                    TArgs&&... args) {
-    WhichDataType which(argument_type);
-#define DISPATCH(TYPE)                \
-    if (which.idx == TypeIndex::TYPE) \
-        return new AggregateFunctionTemplate<TYPE, 
Data>(std::forward<TArgs>(args)...);
-    FOR_NUMERIC_TYPES(DISPATCH)
-#undef DISPATCH
-    return nullptr;
-}
-
-template <template <typename, typename> class AggregateFunctionTemplate,
-          template <typename> class Data, typename... TArgs>
-static IAggregateFunction* create_with_numeric_type(const IDataType& 
argument_type,
-                                                    TArgs&&... args) {
-    WhichDataType which(argument_type);
-#define DISPATCH(TYPE)                \
-    if (which.idx == TypeIndex::TYPE) \
-        return new AggregateFunctionTemplate<TYPE, 
Data<TYPE>>(std::forward<TArgs>(args)...);
-    FOR_NUMERIC_TYPES(DISPATCH)
-#undef DISPATCH
-    return nullptr;
-}
-
+template <template <typename> class AggregateFunctionTemplate, typename Type>
+struct BuilerDirect {

Review Comment:
   Builder



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to