This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 4b819200941 [doc](agg) support group_array_union funciton (#2996)
4b819200941 is described below

commit 4b819200941074895617d2fb79dee9028b84194b
Author: zhangstar333 <[email protected]>
AuthorDate: Fri Oct 24 12:21:19 2025 +0800

    [doc](agg) support group_array_union funciton (#2996)
    
    ## Versions
    
    - [x] dev
    - [ ] 3.x
    - [ ] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [x] Chinese
    - [x] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 .../aggregate-functions/group-array-union.md       | 81 ++++++++++++++++++++++
 .../aggregate-functions/group-array-union.md       | 79 +++++++++++++++++++++
 sidebars.json                                      |  1 +
 3 files changed, 161 insertions(+)

diff --git 
a/docs/sql-manual/sql-functions/aggregate-functions/group-array-union.md 
b/docs/sql-manual/sql-functions/aggregate-functions/group-array-union.md
new file mode 100644
index 00000000000..5094e41537a
--- /dev/null
+++ b/docs/sql-manual/sql-functions/aggregate-functions/group-array-union.md
@@ -0,0 +1,81 @@
+---
+{
+    "title": "GROUP_ARRAY_UNION",
+    "language": "en"
+}
+---
+
+## Description
+
+Find the unique union of all elements from every row in the input array and 
return a new array.
+
+## Syntax
+
+```sql
+GROUP_ARRAY_UNION(<expr>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<expr>` | An expression to calculate union, supported type: Array<Type>. 
Does not support complex type nesting within an Array. |
+
+## Return Value
+
+Returns an array containing the union results. If there is no valid data in 
the group, returns an empty array.
+
+## Example
+
+
+```sql
+-- setup
+CREATE TABLE group_array_union_test (
+       id INT,
+       c_array_string ARRAY<STRING>
+) DISTRIBUTED BY HASH(id) BUCKETS 1
+PROPERTIES ("replication_num" = "1");
+INSERT INTO group_array_union_test VALUES
+       (1, ['a', 'b', 'c', 'd', 'e']),
+       (2, ['a', 'b']),
+       (3, ['a', null]),
+       (4, NULL);
+```
+
+```sql
+select GROUP_ARRAY_UNION(c_array_string) from group_array_union_test;
+```
+
+```text
++-----------------------------------+
+| GROUP_ARRAY_UNION(c_array_string) |
++-----------------------------------+
+| [null, "c", "e", "b", "d", "a"]   |
++-----------------------------------+
+```
+
+```sql
+select GROUP_ARRAY_UNION(c_array_string) from group_array_union_test where id 
in (3,4);
+```
+
+```text
++-----------------------------------+
+| GROUP_ARRAY_UNION(c_array_string) |
++-----------------------------------+
+| [null, "a"]                       |
++-----------------------------------+
+```
+
+```sql
+select GROUP_ARRAY_UNION(c_array_string) from group_array_union_test where id 
in (4);
+```
+
+```text
++-----------------------------------+
+| GROUP_ARRAY_UNION(c_array_string) |
++-----------------------------------+
+| []                                |
++-----------------------------------+
+```
+
+
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/group-array-union.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/group-array-union.md
new file mode 100644
index 00000000000..a87ec81dc1c
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/group-array-union.md
@@ -0,0 +1,79 @@
+---
+{
+"title": "GROUP_ARRAY_UNION",
+"language": "zh-CN"
+}
+---
+
+## 描述
+
+求出所有行中输入数组中的去重后的并集元素,返回一个新的数组
+
+## 语法
+
+```sql
+GROUP_ARRAY_UNION(<expr>)
+```
+
+## 参数
+
+| 参数 | 说明 |
+| -- | -- |
+| `<expr>` | 需要求并集的表达式,支持类型为 Array<Type>, 不支持Array的复杂类型嵌套。 |
+
+## 返回值
+
+返回一个包含并集结果的数组。
+如果组内没有合法数据,则返回空数组。
+
+## 举例
+
+```sql
+-- setup
+CREATE TABLE group_array_union_test (
+       id INT,
+       c_array_string ARRAY<STRING>
+) DISTRIBUTED BY HASH(id) BUCKETS 1
+PROPERTIES ("replication_num" = "1");
+INSERT INTO group_array_union_test VALUES
+       (1, ['a', 'b', 'c', 'd', 'e']),
+       (2, ['a', 'b']),
+       (3, ['a', null]),
+       (4, NULL);
+```
+
+```sql
+select GROUP_ARRAY_UNION(c_array_string) from group_array_union_test;
+```
+
+```text
++-----------------------------------+
+| GROUP_ARRAY_UNION(c_array_string) |
++-----------------------------------+
+| [null, "c", "e", "b", "d", "a"]   |
++-----------------------------------+
+```
+
+```sql
+select GROUP_ARRAY_UNION(c_array_string) from group_array_union_test where id 
in (3,4);
+```
+
+```text
++-----------------------------------+
+| GROUP_ARRAY_UNION(c_array_string) |
++-----------------------------------+
+| [null, "a"]                       |
++-----------------------------------+
+```
+
+```sql
+select GROUP_ARRAY_UNION(c_array_string) from group_array_union_test where id 
in (4);
+```
+
+```text
++-----------------------------------+
+| GROUP_ARRAY_UNION(c_array_string) |
++-----------------------------------+
+| []                                |
++-----------------------------------+
+```
diff --git a/sidebars.json b/sidebars.json
index 93a50ebd80d..a36df116179 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -1822,6 +1822,7 @@
                                 
"sql-manual/sql-functions/aggregate-functions/covar",
                                 
"sql-manual/sql-functions/aggregate-functions/covar-samp",
                                 
"sql-manual/sql-functions/aggregate-functions/group-array-intersect",
+                                
"sql-manual/sql-functions/aggregate-functions/group-array-union",
                                 
"sql-manual/sql-functions/aggregate-functions/group-bit-and",
                                 
"sql-manual/sql-functions/aggregate-functions/group-bit-or",
                                 
"sql-manual/sql-functions/aggregate-functions/group-bit-xor",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to