amorynan commented on code in PR #2671: URL: https://github.com/apache/doris-website/pull/2671#discussion_r2242143203
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-apply.md: ########## @@ -5,44 +5,178 @@ } --- +## array_apply + +<version since="1.2.3"> + +</version> + ## 描述 -数组以特定的二元条件符过滤元素,并返回过滤后的结果 + +使用指定的二元操作符对数组元素进行过滤,返回满足条件的元素组成的新数组。这是一个简化的数组过滤函数,使用预定义的操作符而不是 lambda 表达式。 ## 语法 ```sql -ARRAY_APPLY(<arr>, <op>, <val>) +array_apply(arr, op, val) +``` + +### 参数 + +- `arr`:ARRAY\<T> 类型,要过滤的数组 +- `op`:STRING 类型,过滤条件操作符,必须是常量值。支持的操作符:`=`、`!=`、`>`、`>=`、`<`、`<=` +- `val`:T 类型,过滤的条件值,必须是常量值 + +**T 支持的类型:** +- 数值类型:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE +- 十进制类型:DECIMALV2、DECIMALV3(包括DECIMAL32、DECIMAL64、DECIMAL128I、DECIMAL256) +- 日期时间类型:DATE、DATETIME、DATEV2、DATETIMEV2 +- 布尔类型:BOOLEAN Review Comment: 这里的第三个参数会是 根据 array<boolean> 而变成 true(任意非0值) 或者 false(0 值) ; desc verbose SELECT array_apply(cast([true, false, 0, 1] as array<boolean>), ">", 100); --> array_apply([TRUE, FALSE, FALSE, TRUE], '>', TRUE) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org