diff --git a/dbms/src/AggregateFunctions/AggregateFunctionNull.cpp b/dbms/src/AggregateFunctions/AggregateFunctionNull.cpp index 1859145497b..d2f995dc61f 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionNull.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionNull.cpp @@ -35,6 +35,9 @@ class AggregateFunctionCombinatorNull final : public IAggregateFunctionCombinato AggregateFunctionPtr transformAggregateFunction( const AggregateFunctionPtr & nested_function, const DataTypes & arguments, const Array &) const override { + /// group_concat reuses groupArray and groupUniqArray, it has the special warp function `AggregateFunctionGroupConcat` to process + /// the issues of null, but the warp function needs more complex arguments, it is specially added outside, + /// instead of being added here, so directly return in this function. if (nested_function && (nested_function->getName() == "groupArray" || nested_function->getName() == "groupUniqArray")) return nested_function; bool has_nullable_types = false; diff --git a/dbms/src/AggregateFunctions/AggregateFunctionNull.h b/dbms/src/AggregateFunctions/AggregateFunctionNull.h index 3adc6725c47..a889da7f3e4 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionNull.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionNull.h @@ -1,6 +1,10 @@ #pragma once +#include +#include #include + +#include #include #include #include @@ -17,10 +21,6 @@ #include #include #include - -#include -#include -#include "AggregateFunctionGroupUniqArray.h" #include namespace DB @@ -516,7 +516,7 @@ class AggregateFunctionNullVariadic final : public AggregateFunctionNullBase is_nullable; /// Plain array is better than std::vector due to one indirection less. }; -/// a warp function on the top of groupArray and groupUniqArray +/// a warp function on the top of groupArray and groupUniqArray, like the AggregateFunctionNull /// the input argument is in following two types: /// 1. only one column with original data type and without order_by items, for example: group_concat(c) @@ -537,7 +537,7 @@ class AggregateFunctionGroupConcat final : public AggregateFunctionNullBase(removeNullable(input_args[0])); number_of_concat_items = all_columns_names_and_types.size() - sort_desc.size();