csun5285 commented on code in PR #2685: URL: https://github.com/apache/doris-website/pull/2685#discussion_r2247225512
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-union.md: ########## @@ -5,36 +5,79 @@ } --- -## 描述 +## 功能 -将多个数组进行合并,不包含重复元素,生成一个新数组 +`ARRAY_UNION` 用于返回多个数组的并集,即合并所有数组中出现的元素,去重后组成一个新的数组。 ## 语法 -```sql -ARRAY_UNION(<array>, <array> [, ... ]) +```SQL +ARRAY_UNION(arr1, arr2, ..., arrN) ``` ## 参数 -| 参数 | 说明 | -|--|--| -| `<array>` | 待合并的数组 | - +- `arr1, arr2, ..., arrN`:任意数量的数组输入,类型均为 `ARRAY<T>`。 + - 所有数组的元素类型 `T` 必须一致,或可隐式转换为统一类型。 + - `T` 类型不支持半结构化类型。 + - 参数可以是常量,也可以是变量。 + ## 返回值 -返回一个数组,包含 array1 和 array2 的并集中的所有元素,不包含重复项,如果输入参数为 NULL,则返回 NULL +- 返回一个 ARRAY<T> 类型的新数组, 包含所有输入数组中的唯一元素,即去重后的并集。 + - 如果某一个参数是 `NULL`,返回 `NULL` (见示例)。 -## 举例 +## 使用说明 -```sql -SELECT ARRAY_UNION([1, 2, 3, 6],[1, 2, 5]),ARRAY_UNION([1, 4, 3, 5, NULL],[1,6,10]); -``` +1. 元素的去重依赖等值比较(= 运算符)。 Review Comment: 示例都有 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
