csun5285 commented on code in PR #2845: URL: https://github.com/apache/doris-website/pull/2845#discussion_r2324354189
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-sort.md: ########## @@ -5,36 +5,35 @@ } --- -## 描述 +## 功能 -将数组中的元素升序排列 +对数组元素按升序排序。 ## 语法 -```sql -ARRAY_SORT(<arr>) -``` +- `ARRAY_SORT(arr)` ## 参数 -| 参数 | 说明 | -|--|--| -| `<arr>` | 对应数组 | +- `arr`:`ARRAY<T>`,`T` 可为数值、布尔、字符串、日期时间、IP 等。 ## 返回值 -返回按升序排列后的数组,如果输入数组为 NULL,则返回 NULL。如果数组元素包含 NULL, 则输出的排序数组会将 NULL 放在最前面。 +- 返回与输入同类型的 `ARRAY<T>`。 +- `NULL` 元素放在返回的数组最前面。 -## 举例 +## 使用说明 + +- 若输入为 `NULL`,返回 `NULL`; 若输入为空数组 `[]`,返回空数组。 +- `ARRAY_SORT` 是升序排序,`ARRAY_REVERSE_SORT` 是降序排序。 + +## 示例 + +- 基本: `NULL` 元素放在返回的数组最后面 + - `ARRAY_SORT([2,1,3,null])` -> `[null, 1, 2, 3]` 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]
