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 af2d02b5a7b [doc](function) update doc about retention function (#2588)
af2d02b5a7b is described below

commit af2d02b5a7b1fab641264cfb64516ffa8dee7398
Author: zhangstar333 <[email protected]>
AuthorDate: Wed Jul 2 14:20:36 2025 +0800

    [doc](function) update doc about retention function (#2588)
    
    ## Versions
    
    - [x] dev
    - [x] 3.0
    - [ ] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [ ] Chinese
    - [ ] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 .../sql-functions/aggregate-functions/retention.md   | 18 +++++++++++++++---
 .../sql-functions/aggregate-functions/retention.md   | 20 +++++++++++++++-----
 .../sql-functions/aggregate-functions/retention.md   | 19 +++++++++++++++----
 .../sql-functions/aggregate-functions/retention.md   | 18 ++++++++++++++++--
 4 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/docs/sql-manual/sql-functions/aggregate-functions/retention.md 
b/docs/sql-manual/sql-functions/aggregate-functions/retention.md
index f3c9db38c9f..9d6d8f4082a 100644
--- a/docs/sql-manual/sql-functions/aggregate-functions/retention.md
+++ b/docs/sql-manual/sql-functions/aggregate-functions/retention.md
@@ -26,12 +26,12 @@ RETENTION(<event_1> [, <event_2>, ... , <event_n>]);
 | `<event_n>` | The `n`th event condition, of type `UInt8` and value 1 or 0. |
 
 ## Returned value
-
-An array of 1 and 0 with a maximum length of 32, where the final output array 
length matches the input parameter length.
-
 - 1: Condition is met.
 - 0: Condition is not met.
 
+An array of 1 and 0 with a maximum length of 32, where the final output array 
length matches the input parameter length.
+If no data is involved in the aggregation, a NULL value will be returned.
+
 ## Examples
 
 ```sql
@@ -73,4 +73,16 @@ ORDER BY uid ASC;
 |    1 | [1]  | [1, 1] | [1, 1, 0] |
 |    2 | [1]  | [1, 0] | [1, 0, 0] |
 +------+------+--------+-----------+
+```
+
+```sql
+SELECT RETENTION(date = '2022-10-12') AS r FROM retention_test where uid is 
NULL;
+```
+
+```text
++------+
+| r    |
++------+
+| NULL |
++------+
 ```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/retention.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/retention.md
index 116ef65b021..8bd00dfd625 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/retention.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/retention.md
@@ -26,12 +26,10 @@ RETENTION(<event_1> [, <event_2>, ... , <event_n>]);
 | `<event_n>` | 第`n`个事件条件,类型为`UInt8`,取值为 1 或 0 |
 
 ## 返回值
-
-由 1 和 0 组成的最大长度为 32 位的数组,最终输出数组的长度与输入参数长度相同。
-
 - 1: 条件满足。
-
 - 0: 条件不满足。
+由 1 和 0 组成的最大长度为 32 位的数组,最终输出数组的长度与输入参数长度相同。
+如果在没有任何数据参与聚合的情况下,会返回NULL值
 
 ## 举例
 
@@ -74,4 +72,16 @@ ORDER BY uid ASC;
 |    1 | [1]  | [1, 1] | [1, 1, 0] |
 |    2 | [1]  | [1, 0] | [1, 0, 0] |
 +------+------+--------+-----------+
-```
\ No newline at end of file
+```
+
+```sql
+SELECT RETENTION(date = '2022-10-12') AS r FROM retention_test where uid is 
NULL;
+```
+
+```text
++------+
+| r    |
++------+
+| NULL |
++------+
+```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
index 116ef65b021..293151e5bf1 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
@@ -26,13 +26,12 @@ RETENTION(<event_1> [, <event_2>, ... , <event_n>]);
 | `<event_n>` | 第`n`个事件条件,类型为`UInt8`,取值为 1 或 0 |
 
 ## 返回值
-
-由 1 和 0 组成的最大长度为 32 位的数组,最终输出数组的长度与输入参数长度相同。
-
 - 1: 条件满足。
-
 - 0: 条件不满足。
 
+由 1 和 0 组成的最大长度为 32 位的数组,最终输出数组的长度与输入参数长度相同。
+如果在没有任何数据参与聚合的情况下,会返回NULL值
+
 ## 举例
 
 ```sql
@@ -74,4 +73,16 @@ ORDER BY uid ASC;
 |    1 | [1]  | [1, 1] | [1, 1, 0] |
 |    2 | [1]  | [1, 0] | [1, 0, 0] |
 +------+------+--------+-----------+
+```
+
+```sql
+SELECT RETENTION(date = '2022-10-12') AS r FROM retention_test where uid is 
NULL;
+```
+
+```text
++------+
+| r    |
++------+
+| NULL |
++------+
 ```
\ No newline at end of file
diff --git 
a/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
 
b/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
index f3c9db38c9f..8c0f2f22126 100644
--- 
a/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
+++ 
b/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/retention.md
@@ -26,11 +26,12 @@ RETENTION(<event_1> [, <event_2>, ... , <event_n>]);
 | `<event_n>` | The `n`th event condition, of type `UInt8` and value 1 or 0. |
 
 ## Returned value
+- 1: Condition is met.
+- 0: Condition is not met.
 
 An array of 1 and 0 with a maximum length of 32, where the final output array 
length matches the input parameter length.
+If no data is involved in the aggregation, a NULL value will be returned.
 
-- 1: Condition is met.
-- 0: Condition is not met.
 
 ## Examples
 
@@ -73,4 +74,17 @@ ORDER BY uid ASC;
 |    1 | [1]  | [1, 1] | [1, 1, 0] |
 |    2 | [1]  | [1, 0] | [1, 0, 0] |
 +------+------+--------+-----------+
+```
+
+
+```sql
+SELECT RETENTION(date = '2022-10-12') AS r FROM retention_test where uid is 
NULL;
+```
+
+```text
++------+
+| r    |
++------+
+| NULL |
++------+
 ```
\ No newline at end of file


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

Reply via email to