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
The `arrayFill` function sequentially processes a source array from the first element
133
133
to the last, evaluating a lambda condition at each position using elements from
134
-
the source and condition arrays. When the condition evaluates to false at
134
+
the source and condition arrays. When the lambda function evaluates to false at
135
135
position i, the function replaces that element with the element at position i-1
136
136
from the current state of the array. The first element is always preserved
137
137
regardless of any condition.
138
-
139
-
`arrayFill` is a [higher-order function](/sql-reference/functions/overview#higher-order-functions). You must pass a lambda function to it as the first argument, and it can't be omitted.
{"λ(x [, y1, ..., yN])", "A lambda function `λ(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)."},
141
+
{"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)."},
144
142
{"source", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
145
143
{"[, cond1, ... , condN]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
146
144
};
@@ -162,16 +160,14 @@ from the source and condition arrays. When the condition evaluates to false at
162
160
position i, the function replaces that element with the element at position i+1
163
161
from the current state of the array. The last element is always preserved
164
162
regardless of any condition.
165
-
166
-
`arrayReverseFill` is a [higher-order function](/sql-reference/functions/overview#higher-order-functions). You must pass a lambda function to it as the first argument, and it can't be omitted.
{"λ(x [, y1, ..., yN])", "A lambda function `λ(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)."},
166
+
{"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)."},
171
167
{"source", "The source array to process [`Array(T)`](/sql-reference/data-types/array)."},
172
168
{"[, cond1, ... , condN]", "Optional. N condition arrays providing additional arguments to the lambda function. [`Array(T)`](/sql-reference/data-types/array)."},
173
169
};
174
-
FunctionDocumentation::ReturnedValue returned_value_reverse = "Returns an array with replaced elements. [`Array(T)`](/sql-reference/data-types/array).";
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 `arrN` for which `func(arr1[i], ..., arrN[i])` return something other than `0`.";
FunctionDocumentation::Description description = "Returns an array containing only the elements in the source array for which a lambda function returns something other than `0`.";
{"func", "Function to apply to each element of the array(s). [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)"},
56
-
{"arr1 [, arr2, ... , arrN)]", "N arrays over which to operate. [`Array(T)`](/sql-reference/data-types/array)."},
55
+
{"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)."},
57
58
};
58
-
FunctionDocumentation::ReturnedValue returned_value = "Returns a filtered array. [`Array(T)`](/sql-reference/data-types/array).";
59
+
FunctionDocumentation::ReturnedValue returned_value = "Returns a subset of the source array. [`Array(T)`](/sql-reference/data-types/array).";
59
60
FunctionDocumentation::Examples examples = {
60
61
{"Example 1", "SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res", "['abc World']"},
Returns an array obtained from the original arrays by application of `func(arr1[i], ..., arrN[i])` for each element.
11
-
Arrays `arr1` ... `arrN` must have the same number of elements.
12
-
13
-
`arrayMap` is a [higher-order function](/sql-reference/functions/overview#higher-order-functions). You must pass a lambda function to it as the first argument, and it can't be omitted.
10
+
Returns an array obtained from the original arrays by applying a lambda function to each element.
{"func", "Function to apply to each element of the array(s). Optional. [Lambda function](/sql-reference/functions/overview#arrow-operator-and-lambda)"},
18
-
{"arr1 [, ..., arrN]", "N arrays to apply `f` to. [Array(T)](/sql-reference/data-types/array)."},
14
+
{"func", "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)."},
15
+
{"arr", "N arrays to process. [Array(T)](/sql-reference/data-types/array)."},
19
16
};
20
-
FunctionDocumentation::ReturnedValue returned_value = "Returns an array with elements the results of applying `f` to the original array. [`Array(T)`](/sql-reference/data-types/array)";
17
+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array from the lambda results. [`Array(T)`](/sql-reference/data-types/array)";
0 commit comments