You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Functions/array/arrayCompact.cpp
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,18 @@ using FunctionArrayCompact = FunctionArrayMapped<ArrayCompactImpl, NameArrayComp
161
161
162
162
REGISTER_FUNCTION(ArrayCompact)
163
163
{
164
-
factory.registerFunction<FunctionArrayCompact>();
164
+
FunctionDocumentation::Description description = "Removes consecutive duplicate elements from an array, including `null` values. The order of values in the resulting array is determined by the order in the source array.";
{"arr", "A multidimensional array. [`Array(T)`](/sql-reference/data-types/array)(`Array`)"}
138
+
};
139
+
FunctionDocumentation::ReturnedValue returned_value = "Returns a flattened array from the multidimensional array. [`Array(T)`](/sql-reference/data-types/array).";
FunctionDocumentation::Description description = "Applies a lambda function to one or more equally-sized arrays and collects the result in an accumulator.";
{"λ(x, x1 [, x2, x3, ... xN])", "A lambda function `λ(acc, x1 [, x2, x3, ... xN]) → F(acc, x1 [, x2, x3, ... xN])` where `F` is an operation applied to `acc` and array values from `x` with the result of `acc` re-used. [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
296
+
{"arr1 [, arr2, arr3, ... arrN]", "N arrays over which to operate. [`Array(T)`](/sql-reference/data-types/array)"},
297
+
{"acc", "Accumulator value with the same type as the return type of the Lambda function."}
298
+
};
299
+
FunctionDocumentation::ReturnedValue returned_value = "Returns the final `acc` value.";
)"},{"Example with aggregate function using multiple arguments", R"(If an aggregate function takes multiple arguments, then this function must be applied to multiple arrays of the same size.
235
+
236
+
```sql
237
+
SELECT arrayReduce('maxIf', [3, 5], [1, 0]);
238
+
```
239
+
)", R"(
240
+
┌─arrayReduce('maxIf', [3, 5], [1, 0])─┐
241
+
│ 3 │
242
+
└──────────────────────────────────────┘
243
+
)"},{"Example with a parametric aggregate function", R"(
{"agg_f", "The name of the aggregate function to use. [String](/sql-reference/data-types/string)"},
397
+
{"ranges", "The range over which to aggregate. An array of tuples, `(i, r)` containing the index `i` from which to begin from and the range `r` over which to aggregate [`Array(T)`](/sql-reference/data-types/array)([`Tuple(T1, T2, ...)`](/sql-reference/data-types/tuple))"},
398
+
{"arr1 [, arr2, ... ,arrN)]", "N arrays as arguments to the aggregate function. [`Array(T)`](/sql-reference/data-types/array)."},
399
+
};
400
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array containing results of the aggregate function over the specified ranges. [`Array(T)`](/sql-reference/data-types/array).";
{"arr", "The array to reverse. [`Array(T)`](/sql-reference/data-types/array)."}
260
+
};
261
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array of the same size as the original array containing the elements in reverse order. [`Array(T)`](/sql-reference/data-types/array).";
Combines multiple arrays into a single array. The resulting array contains the corresponding elements of the source arrays grouped into tuples in the listed order of arguments.
Combines multiple arrays into a single array, allowing for unaligned arrays. The resulting array contains the corresponding elements of the source arrays grouped into tuples in the listed order of arguments.
183
-
184
-
If the arrays have different sizes, the shorter arrays will be padded with `null` values.
FunctionDocumentation::Description description = "Combines multiple arrays into a single array. The resulting array contains the corresponding elements of the source arrays grouped into tuples in the listed order of arguments.";
FunctionDocumentation::Arguments argument = {{"arr1, arr2, ... , arrN", "N arrays to combine into a single array. [`Array(T)`](/sql-reference/data-types/array)"}};
177
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array with elements from the source arrays grouped in tuples. Data types in the tuple are the same as types of the input arrays and in the same order as arrays are passed. [`Array(T)`](/sql-reference/data-types/array)([`Tuple`](/sql-reference/data-types/tuple)).";
FunctionDocumentation::Description description_unaligned = "Combines multiple arrays into a single array, allowing for unaligned arrays (arrays of differing lengths). The resulting array contains the corresponding elements of the source arrays grouped into tuples in the listed order of arguments.";
FunctionDocumentation::Arguments argument_unaligned = {{"arr1, arr2, ..., arrN", "N arrays to combine into a single array. [`Array(T)`](/sql-reference/data-types/array)."}};
188
+
FunctionDocumentation::ReturnedValue returned_value_unaligned = "Returns an array with elements from the source arrays grouped in tuples. Data types in the tuple are the same as types of the input arrays and in the same order as arrays are passed. [`Array(T)`](/sql-reference/data-types/array)([`Tuple(T1, T2, ...)`](/sql-reference/data-types/tuple)).";
0 commit comments