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: docs/en/sql-reference/functions/array-functions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2624,7 +2624,7 @@ Note that the `arrayLastIndex` is a [higher-order function](/sql-reference/funct
2624
2624
2625
2625
Returns the minimum of elements in the source array.
2626
2626
2627
-
If the `func` function is specified, returns the mininum of elements converted by this function.
2627
+
If the `func` function is specified, returns the minimum of elements converted by this function.
2628
2628
2629
2629
Note that the `arrayMin` is a [higher-order function](/sql-reference/functions/overview#higher-order-functions). You can pass a lambda function to it as the first argument.
{"func(x[, y1, ..., yN])", "Optional. A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
457
+
{"source_arr", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
458
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
459
+
};
460
+
FunctionDocumentation::ReturnedValue returned_value_min = "Returns the minimum element in the source array, or the minimum element of the lambda results if provided.";
{"func(x[, y1, ..., yN])", "Optional. A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
479
+
{"source_arr", "The source array to process. [`Array(T)`](/sql-reference/data-types/array)."},
480
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
481
+
};
482
+
FunctionDocumentation::ReturnedValue returned_value_max = "Returns the maximum element in the source array, or the minimum element of the lambda results if provided.";
{"func(x[, y1, ..., yN])", "Optional. A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
501
+
{"source_arr", "The source array to process. [`Array(T)`](/sql-reference/data-types/array)."},
502
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
503
+
};
504
+
FunctionDocumentation::ReturnedValue returned_value_sum = "Returns the sum of elements in the source array, or the sum of elements of the lambda results if provided.";
{"func(x[, y1, ..., yN])", "Optional. A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
523
+
{"source_arr", "The source array to process. [`Array(T)`](/sql-reference/data-types/array)."},
524
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
525
+
};
526
+
FunctionDocumentation::ReturnedValue returned_value_avg = "Returns the average of elements in the source array, or the average of elements of the lambda results if provided. [`Float64`](/sql-reference/data-types/float).";
{"func(x[, y1, ..., yN])", "Optional. A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
545
+
{"source_arr", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
546
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
547
+
};
548
+
FunctionDocumentation::ReturnedValue returned_value_prod = "Returns the product of elements in the source array, or the product of elements of the lambda results if provided. [`Float64`](/sql-reference/data-types/float).";
{"func(x[, y1, ..., yN])", "A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
72
+
{"source_arr", "The source array to process. [`Array(T)`](/sql-reference/data-types/array)."},
73
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."}
74
+
};
75
+
FunctionDocumentation::ReturnedValue returned_value = "Returns `1` if the lambda function returns true for all elements, `0` otherwise. [`UInt8`](/sql-reference/data-types/int-uint).";
76
+
FunctionDocumentation::Examples examples = {
77
+
{"All elements match", "SELECT arrayAll(x, y -> x=y, [1, 2, 3], [1, 2, 3])", "1"},
78
+
{"Not all elements match", "SELECT arrayAll(x, y -> x=y, [1, 2, 3], [1, 1, 1])", "0"}
Returns the number of elements for which `func(arr1[i], ..., arrN[i])` returns something other than `0`.
85
+
Returns the number of elements for which `func(arr1[i], ..., arrN[i])` returns true.
86
86
If `func` is not specified, it returns the number of non-zero elements in the array.
87
87
88
88
`arrayCount` is a [higher-order function](/sql-reference/functions/overview#higher-order-functions).
@@ -92,7 +92,7 @@ If `func` is not specified, it returns the number of non-zero elements in the ar
92
92
{"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.";
95
+
FunctionDocumentation::ReturnedValue returned_value = "Returns the number of elements for which `func` returns true. Otherwise, returns the number of non-zero elements in the array.";
96
96
FunctionDocumentation::Examples example = {{"Usage example", "SELECT arrayCount(x -> (x % 2), groupArray(number) FROM numbers(10)", "5"}};
{"func(x[, y1, ..., yN])", "A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
73
+
{"source_arr", "The source array to process. [`Array(T)`](/sql-reference/data-types/array)."},
74
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."}
75
+
};
76
+
FunctionDocumentation::ReturnedValue returned_value = "Returns `1` if the lambda function returns true for at least one element, `0` otherwise. [`UInt8`](/sql-reference/data-types/int-uint).";
{"func(x [, y1, ..., yN])", "A lambda function `func(x [, y1, y2, ... yN]) → F(x [, y1, y2, ... yN])` which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
142
-
{"source", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
143
-
{"[, cond1, ... , condN]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
142
+
{"source_arr", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
143
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
144
144
};
145
145
FunctionDocumentation::ReturnedValue returned_value = "Returns an array. [`Array(T)`](/sql-reference/data-types/array).";
146
146
FunctionDocumentation::Examples examples = {
@@ -161,11 +161,11 @@ position i, the function replaces that element with the element at position i+1
161
161
from the current state of the array. The last element is always preserved
{"func(x[, y1, ..., yN])", "A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
167
-
{"source", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
168
-
{"[, cond1, ... , condN]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
167
+
{"source_arr", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
168
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
169
169
};
170
170
FunctionDocumentation::ReturnedValue returned_value_reverse = "Returns an array with elements of the source array replaced by the results of the lambda. [`Array(T)`](/sql-reference/data-types/array).";
FunctionDocumentation::Description description = "Returns an array containing only the elements in the source array for which a lambda function returns something other than `0`.";
FunctionDocumentation::Description description = "Returns an array containing only the elements in the source array for which a lambda function returns true.";
{"func(x[, y1, ..., yN])", "A lambda function which operates on elements of the source array (`x`) and condition arrays (`y`). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)."},
56
-
{"source", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
57
-
{"[, cond1, ... , condN]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
56
+
{"source_arr", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
57
+
{"[, cond1_arr, ... , condN_arr]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
58
58
};
59
59
FunctionDocumentation::ReturnedValue returned_value = "Returns a subset of the source array. [`Array(T)`](/sql-reference/data-types/array).";
0 commit comments