yiguolei commented on code in PR #2685:
URL: https://github.com/apache/doris-website/pull/2685#discussion_r2247024320
##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-sum.md:
##########
@@ -5,36 +5,62 @@
}
---
-## 描述
+### 功能
-计算数组中所有元素之和
+`ARRAY_SUM` 函数用于对数组中的所有数值元素求和。
## 语法
-```sql
-ARRAY_SUM(<src>)
+```SQL
+ARRAY_SUM(ARRAY<T>)
```
## 参数
-| 参数 | 说明 |
-|--|--|
-| `<src>` | 对应数组 |
+`ARRAY<T>`:一个包含**数值类型**元素的数组。
## 返回值
-返回数组中所有元素之和,数组中的 NULL 值会被跳过。空数组以及元素全为 NULL 值的数组,结果返回 NULL 值。
+- 返回数组中所有非 `NULL` 元素的总和。
-## 举例
+ - 如果全是 `NULL`,返回 `NULL`。
-```sql
-SELECT ARRAY_SUM([1, 2, 3, 6]),ARRAY_SUM([1, 4, 3, 5, NULL]),ARRAY_SUM([NULL]);
-```
+## 使用说明
-```text
-+-------------------------+-------------------------------+-------------------------------------------+
-| array_sum([1, 2, 3, 6]) | array_sum([1, 4, 3, 5, NULL]) |
array_sum(cast([NULL] as ARRAY<BOOLEAN>)) |
-+-------------------------+-------------------------------+-------------------------------------------+
-| 12 | 13 |
NULL |
-+-------------------------+-------------------------------+-------------------------------------------+
-```
+1. 元素的求和使用 + 运算符。
+
+2. 对于包含 `NULL` 的元素,会自动忽略这些元素。
+
+3. 如果数组包含非数值类型元素(如字符串),将导致运行错误。
+
+## 示例
+
+```SQL
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]