yiguolei commented on code in PR #2671: URL: https://github.com/apache/doris-website/pull/2671#discussion_r2241453274
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-concat.md: ########## @@ -5,75 +5,196 @@ } --- +## array_concat + +<version since="2.0.0"> + +</version> + ## 描述 -将输入的所有数组拼接为一个数组 +将输入的所有数组拼接为一个数组。函数接受一个或更多数组作为参数,按照参数顺序将它们连接成一个新的数组。 ## 语法 + ```sql -ARRAY_CONCAT(<arr1> [,<arr2> , ...]) +array_concat(ARRAY<T> arr1, [ARRAY<T> arr2, ...]) ``` -## 参数 -| 参数 | 说明 | -|---|---| -| `<arr1>` | 源数组 | -| `<arr2>` | 要添加到 arr1 的数组 | +### 参数 + +- `arr1, arr2, ...`:ARRAY\<T> 类型,要拼接的数组。支持列名或常量值。 + +**T 支持的类型:** +- 数值类型:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE、DECIMAL +- 字符串类型:CHAR、VARCHAR、STRING +- 日期时间类型:DATE、DATETIME、DATEV2、DATETIMEV2 +- 布尔类型:BOOLEAN +- IP 类型:IPV4、IPV6 +- 复杂数据类型:ARRAY、MAP、STRUCT + +### 返回值 -## 返回值 +返回类型:ARRAY\<T> -拼接好的数组,特殊情况: -- 如果数组是 NULL(非[NULL]),则返回 NULL +返回值含义: +- 拼接后的新数组,包含所有输入数组的元素,顺序保持不变 +- NULL:如果任何一个输入数组为 NULL -## 举例 +使用说明: +- 空数组会被忽略,不添加任何元素 +- 只有一个数组且为空数组时,返回空数组;只有一个数组且为 NULL 时,返回 NULL +- 复杂类型(嵌套数组、MAP、STRUCT)拼接时要求结构完全一致,否则报错 +- 函数是 nullsafe 的 Review Comment: 这个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