ARRAY_APPLY
Descriptionβ
Filter array to match specific binary condition
Syntaxβ
ARRAY_APPLY(<arr>, <op>, <val>)
Parametersβ
Parameter | Description |
---|---|
<arr> | Input array |
<op> | Filter condition, including = , >= , <= , > , < , != |
<val> | Filter value. If null , the result will be null . Only constant values are supported. |
Return Valueβ
The filtered array matched with condition.
Exampleβ
select array_apply([1, 2, 3, 4, 5], ">=", 2);
+--------------------------------------------+
| array_apply(ARRAY(1, 2, 3, 4, 5), '>=', 2) |
+--------------------------------------------+
| [2, 3, 4, 5] |
+--------------------------------------------+
select array_apply([1000000, 1000001, 1000002], "=", "1000002");
+-------------------------------------------------------------+
| array_apply(ARRAY(1000000, 1000001, 1000002), '=', 1000002) |
+-------------------------------------------------------------+
| [1000002] |
+-------------------------------------------------------------+