yiguolei commented on code in PR #2671: URL: https://github.com/apache/doris-website/pull/2671#discussion_r2241454649
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-contains.md: ########## @@ -1,50 +1,214 @@ --- { - "title": "ARRAY_CONTAINS", - "language": "zh-CN" + "title": "ARRAY_CONTAINS", + "language": "zh-CN" } --- ## array_contains -array_contains +<version since="1.2.0"> + + +</version> ## 描述 +检查数组中是否包含指定的值。如果找到则返回 true,否则返回 false。如果数组为 NULL,则返回 NULL。 + ## 语法 -`BOOLEAN array_contains(ARRAY<T> arr, T value)` +```sql +array_contains(ARRAY<T> arr, T value) +``` + +### 参数 + +- `arr`:ARRAY<T> 类型,要检查的数组。支持列名或常量值。 +- `value`:T 类型,要查找的值。类型必须与数组元素类型兼容。 + +**T 支持的类型:** +- 数值类型:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE、DECIMAL +- 字符串类型:CHAR、VARCHAR、STRING +- 日期时间类型:DATE、DATETIME、DATEV2、DATETIMEV2 +- 布尔类型:BOOLEAN +- IP 类型:IPV4、IPV6 + +### 返回值 + +返回类型:BOOLEAN -判断数组中是否包含 value。返回结果如下: +返回值含义: +- true:如果数组中包含指定的值 +- false:如果数组中不包含指定的值 +- NULL:如果输入数组为 NULL +返回值行为说明: + +1. 边界条件行为: + - 当输入数组为空时,返回 false + - 当输入数组为 NULL 时,返回 NULL + - 当数组元素类型与查找值类型不匹配时,返回 false + - 函数是 nullsafe 的 Review Comment: 跟44行是矛盾的 -- 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