amorynan commented on code in PR #2671: URL: https://github.com/apache/doris-website/pull/2671#discussion_r2241475135
########## 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 + +### 返回值 + +返回类型:ARRAY\<T> + +返回值含义: +- 返回满足过滤条件的所有元素组成的新数组 +- NULL:如果输入数组为 NULL 或条件值为 NULL +- 空数组:如果没有元素满足条件 + +使用说明: +- 操作符和条件值必须是常量,不能是列名或表达式 +- 支持的类型有限,主要是数值、日期和布尔类型 +- 空数组返回空数组,NULL 数组返回 NULL +- 函数是 nullsafe 的 Review Comment: array_apply 不是nullsafe 我去掉下 -- 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