array_apply
SinceVersion 1.2.3
array_apply
description
数组以特定的二元条件符过滤元素, 并返回过滤后的结果
Syntax
1. array_apply(arr, op, val)
Arguments
arr — 输入的数组, 如果是null, 则返回null op — 过滤条件, 条件包括 =, >=, <=, >, <, !=,仅支持常量 val — 过滤的条件值, 如果是null, 则返回null,仅支持常量
Returned value
过滤后的数组
类型: Array.
notice
只支持在向量化引擎中使用。
example
1. mysql> select array_apply([1, 2, 3, 4, 5], ">=", 2);
2. +--------------------------------------------+
3. | array_apply(ARRAY(1, 2, 3, 4, 5), '>=', 2) |
4. +--------------------------------------------+
5. | [2, 3, 4, 5] |
6. +--------------------------------------------+
7. 1 row in set (0.01 sec)
9. mysql> select array_apply([1000000, 1000001, 1000002], "=", "1000002");
10. +-------------------------------------------------------------+
11. | array_apply(ARRAY(1000000, 1000001, 1000002), '=', 1000002) |
12. +-------------------------------------------------------------+
13. | [1000002] |
14. +-------------------------------------------------------------+
15. 1 row in set (0.01 sec)
keywords
ARRAY,APPLY,ARRAY_APPLY
