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
{"func", "Function to apply to each element of the array(s). Optional. [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)"},
FunctionDocumentation::ReturnedValue returned_value = "Returns the number of elements for which `func` returns something other than `0`. Otherwise, returns the number of non-zero elements in the array.";
96
+
FunctionDocumentation::Examples example = {{"Usage example", "SELECT arrayCount(x -> (x % 2), groupArray(number) FROM numbers(10)", "5"}};
{"clear_depth", "Enumerate elements at the specified level separately. Positive [Integer](../data-types/int-uint.md) less than or equal to `max_arr_depth`."},
27
+
{"arr", "N-dimensional array to enumerate. [Array](/sql-reference/data-types/array)."},
28
+
{"max_array_depth", "The maximum effective depth. Positive [Integer](../data-types/int-uint.md) less than or equal to the depth of `arr`."}
29
+
};
30
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an N-dimensional array the same size as `arr` with each element showing the position of that element in relation to other elements of the same value.";
31
+
FunctionDocumentation::Examples examples = {
32
+
{"Example 1", R"(
33
+
With `clear_depth=1` and `max_array_depth=1`, the result of `arrayEnumerateUniqRanked` is identical to that which [`arrayEnumerateUniq`](#arrayenumerateuniq) would give for the same array.
34
+
35
+
```sql
36
+
SELECT arrayEnumerateUniqRanked(1, [1,2,1], 1);
37
+
```
38
+
)", "[1,1,2]"},
39
+
{"Example 2", R"(
40
+
41
+
With `clear_depth=1` and `max_array_depth=1`, the result of `arrayEnumerateUniqRanked` is identical to that which [`arrayEnumerateUniq`](#arrayenumerateuniq) would give for the same array.
In this example, `arrayEnumerateUniqRanked` is used to obtain an array indicating, for each element of the multidimensional array, what its position is among elements of the same value. For the first row of the passed array,`[1,2,3]`, the corresponding result is `[1,1,1]`, indicating that this is the first time `1`,`2` and `3` are encountered. For the second row of the provided array,`[2,2,1]`, the corresponding result is `[2,3,3]`, indicating that `2` is encountered for a second and third time, and `1` is encountered for the second time. Likewise, for the third row of the provided array `[3]` the corresponding result is `[2]` indicating that `3` is encountered for the second time.
FunctionDocumentation::Arguments arguments = {{"arr", "The array for which to remove the last element from. [`Array(T)`](/sql-reference/data-types/array)."}};
21
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array identical to `arr` but without the last element of `arr`. [`Array(T)`](/sql-reference/data-types/array).";
FunctionDocumentation::Arguments arguments = {{"arr", "The array for which to remove the first element from. [`Array(T)`](/sql-reference/data-types/array)."}};
21
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array identical to `arr` but without the first element of `arr`. [`Array(T)`](/sql-reference/data-types/array).";
{"arr", "The array for which to add value `x` to the end of. [`Array(T)`](/sql-reference/data-types/array)."},
22
+
{"x", R"(
23
+
- Single value to add to the end of the array. [`Array(T)`](/sql-reference/data-types/array).
24
+
25
+
:::note
26
+
- Only numbers can be added to an array with numbers, and only strings can be added to an array of strings.
27
+
- When adding numbers, ClickHouse automatically sets the type of `x` for the data type of the array.
28
+
- Can be `NULL`. The function adds a `NULL` element to an array, and the type of array elements converts to `Nullable`.
29
+
30
+
For more information about the types of data in ClickHouse, see [Data types](/sql-reference/data-types).
31
+
:::
32
+
)"},
33
+
};
34
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array identical to `arr` but with an additional value `x` at the end of the array. [`Array(T)`](/sql-reference/data-types/array).";
{"arr", "The array for which to add value `x` to the end of. [`Array(T)`](/sql-reference/data-types/array)."},
24
+
{"x", R"(
25
+
- Single value to add to the start of the array. [`Array(T)`](/sql-reference/data-types/array).
26
+
27
+
:::note
28
+
- Only numbers can be added to an array with numbers, and only strings can be added to an array of strings.
29
+
- When adding numbers, ClickHouse automatically sets the type of `x` for the data type of the array.
30
+
- Can be `NULL`. The function adds a `NULL` element to an array, and the type of array elements converts to `Nullable`.
31
+
32
+
For more information about the types of data in ClickHouse, see [Data types](/sql-reference/data-types).
33
+
:::
34
+
)"},
35
+
};
36
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array identical to `arr` but with an additional value `x` at the beginning of the array. [`Array(T)`](/sql-reference/data-types/array).";
{"arr", "Array to search. [`Array(T)`](/sql-reference/data-types/array)."},
20
+
{"x", "Value in the array to count. Any type."}
21
+
};
22
+
FunctionDocumentation::ReturnedValue returned_value = "Returns the number of elements in the array equal to `x`. [UInt64](/sql-reference/data-types/int-uint).";
{"set", "Array of any type with a set of elements. [`Array`](/sql-reference/data-types/array)."},
29
+
{"subset", "Array of any type that shares a common supertype with `set` containing elements that should be tested to be a subset of `set`. [`Array`](/sql-reference/data-types/array)."},
0 commit comments