yiguolei commented on code in PR #2671:
URL: https://github.com/apache/doris-website/pull/2671#discussion_r2246680649


##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-difference.md:
##########
@@ -5,57 +5,176 @@
 }
 ---
 
+## array_difference
+
+<version since="2.0.0">
+
+</version>
+
 ## 描述
-计算相邻数组元素之间的差异。返回一个数组,其中第一个元素将为 0,第二个元素是 a[1]-a[0]之间的差值。
-注意若 NULL 值存在,返回结果为 NULL
+
+计算数组中相邻元素的差值。函数会从左到右遍历数组,计算每个元素与其前一个元素的差值,返回一个与原数组等长的新数组。第一个元素的差值始终为 0。
 
 ## 语法
+
 ```sql
-ARRAY_DIFFERENCE(<arr>)
+array_difference(ARRAY<T> arr)
 ```
 
-## 参数
-| 参数 | 说明 |
-|---|---|
-| `<arr>` | 用于相邻数组元素之间的差异的数组 |
+### 参数
+
+- `arr`:ARRAY\<T> 类型,要计算差值的数组。支持列名或常量值。
+
+**T 支持的类型:**
+- 数值类型:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE、DECIMAL
 
-## 返回值
-返回一个数组。特殊情况:
-- 如果 NULL 值存在,返回结果为 NULL
 
-## 举例
+### 返回值
+
+返回类型:ARRAY\<T>
+
+返回值含义:
+- 返回一个与输入数组等长的新数组,每个位置的值为当前元素与前一个元素的差值,第一个元素的差值为 0
+- NULL:如果输入数组为 NULL
+
+使用说明:
+- 如果数组包含其他类型(如字符串、日期等),会尝试将元素转换为 DOUBLE 类型。转换失败的元素结果为 null,不参与差值计算。

Review Comment:
   这里,我们对于【1,null,3】 返回什么结果呢



-- 
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]

Reply via email to