diff --git a/docs/en/sql-reference/aggregate-functions/reference/grouparraysorted.md b/docs/en/sql-reference/aggregate-functions/reference/grouparraysorted.md deleted file mode 100644 index e34fcbc5788..00000000000 --- a/docs/en/sql-reference/aggregate-functions/reference/grouparraysorted.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 108 ---- - -# groupArraySorted {#groupArraySorted} - -Returns an array with the first N items in ascending order. - -``` sql -groupArraySorted(N)(column) -``` - -**Arguments** - -- `N` – The number of elements to return. - -If the parameter is omitted, default value 10 is used. - -**Arguments** - -- `column` – The value. -- `expr` — Optional. The field or expresion to sort by. If not set values are sorted by themselves. - -**Example** - -Gets the first 10 numbers: - -``` sql -SELECT groupArraySorted(10)(number) FROM numbers(100) -``` - -``` text -┌─groupArraySorted(10)(number)─┐ -│ [0,1,2,3,4,5,6,7,8,9] │ -└──────────────────────────────┘ -``` - -Or the last 10: - -``` sql -SELECT groupArraySorted(10)(number, -number) FROM numbers(100) -``` - -``` text -┌─groupArraySorted(10)(number, negate(number))─┐ -│ [99,98,97,96,95,94,93,92,91,90] │ -└──────────────────────────────────────────────┘ -``` \ No newline at end of file diff --git a/src/AggregateFunctions/AggregateFunctionGroupArraySorted.cpp b/src/AggregateFunctions/AggregateFunctionGroupArraySorted.cpp deleted file mode 100644 index 50d5f075322..00000000000 --- a/src/AggregateFunctions/AggregateFunctionGroupArraySorted.cpp +++ /dev/null @@ -1,147 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - - -static inline constexpr UInt64 GROUP_SORTED_ARRAY_MAX_SIZE = 0xFFFFFF; -static inline constexpr UInt64 GROUP_SORTED_ARRAY_DEFAULT_THRESHOLD = 10; - - -namespace DB -{ -struct Settings; - -namespace ErrorCodes -{ - extern const int ARGUMENT_OUT_OF_BOUND; - extern const int ILLEGAL_TYPE_OF_ARGUMENT; - extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; -} - - -namespace -{ - template - class AggregateFunctionGroupArraySortedNumeric : public AggregateFunctionGroupArraySorted - { - using AggregateFunctionGroupArraySorted::AggregateFunctionGroupArraySorted; - }; - - template - class AggregateFunctionGroupArraySortedFieldType - : public AggregateFunctionGroupArraySorted - { - using AggregateFunctionGroupArraySorted:: - AggregateFunctionGroupArraySorted; - DataTypePtr getReturnType() const override { return std::make_shared(std::make_shared()); } - }; - - template