morrySnow commented on code in PR #1907: URL: https://github.com/apache/doris-website/pull/1907#discussion_r1925224773
########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-range.md: ########## @@ -24,76 +24,53 @@ specific language governing permissions and limitations under the License. --> -## array_range -array_range +## Description -### description +1. Generate int array +2. Generate date and time array -#### Syntax +## Aliases + +- SEQUENCE + +## Syntax ```sql -ARRAY<Int> array_range(Int end) -ARRAY<Int> array_range(Int start, Int end) -ARRAY<Int> array_range(Int start, Int end, Int step) -ARRAY<Datetime> array_range(Datetime start_datetime, Datetime end_datetime) -ARRAY<Datetime> array_range(Datetime start_datetime, Datetime end_datetime, INTERVAL Int interval_step UNIT) +ARRAY_RANGE(end) +ARRAY_RANGE(start, end) +ARRAY_RANGE(start, end, step) +ARRAY_RANGE(start_datetime, end_datetime) +ARRAY_RANGE(start_datetime, end_datetime, INTERVAL interval_step UNIT) Review Comment: 参数需要加尖括号 ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-repeat.md: ########## @@ -23,3 +23,39 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> + + +## Description + +Generates an array containing n repeated elements T + +## Syntax + +```sql +ARRAY_REPEAT(<T>, <n>) Review Comment: ```suggestion ARRAY_REPEAT(<element>, <n>) ``` ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-shuffle.md: ########## @@ -24,58 +24,42 @@ specific language governing permissions and limitations under the License. --> -## array_shuffle -array_shuffle -shuffle +## Description -### description +Randomly arrange the elements in an array -#### Syntax +## Aliases + +- SHUFFLE + +## Syntax ```sql -ARRAY<T> array_shuffle(ARRAY<T> array1, [INT seed]) -ARRAY<T> shuffle(ARRAY<T> array1, [INT seed]) +ARRAY_SHUFFLE(<array1>, <seed>) Review Comment: ```suggestion ARRAY_SHUFFLE(<array>, <seed>) ``` ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-with-constant.md: ########## @@ -22,57 +22,38 @@ specific language governing permissions and limitations under the License. --> -## array_with_constant -array_with_constant +## Description -### description +Generates an array containing n repeated elements T -#### Syntax +## Syntax ```sql -ARRAY<T> array_with_constant(n, T) -ARRAY<T> array_repeat(T, n) +ARRAY_WITH_CONSTANT(<n>, <T>) Review Comment: ```suggestion ARRAY_WITH_CONSTANT(<n>, <element>) ``` ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-union.md: ########## @@ -24,61 +24,38 @@ specific language governing permissions and limitations under the License. --> -## array_union -array_union +## Description -### description +Merge multiple arrays without duplicate elements to generate a new array -#### Syntax - -`ARRAY<T> array_union(ARRAY<T> array1, ARRAY<T> array2)` - -Returns an array of the elements in the union of array1 and array2, without duplicates. If the input parameter is null, null is returned. - -### example +## Syntax +```sql +ARRAY_UNION(<array1>, <array2>) ``` -mysql> select k1,k2,k3,array_union(k2,k3) from array_type_table; -+------+-----------------+--------------+-------------------------+ -| k1 | k2 | k3 | array_union(`k2`, `k3`) | -+------+-----------------+--------------+-------------------------+ -| 1 | [1, 2, 3] | [2, 4, 5] | [1, 2, 3, 4, 5] | -| 2 | [2, 3] | [1, 5] | [2, 3, 1, 5] | -| 3 | [1, 1, 1] | [2, 2, 2] | [1, 2] | -+------+-----------------+--------------+-------------------------+ -mysql> select k1,k2,k3,array_union(k2,k3) from array_type_table_nullable; -+------+-----------------+--------------+-------------------------+ -| k1 | k2 | k3 | array_union(`k2`, `k3`) | -+------+-----------------+--------------+-------------------------+ -| 1 | [1, NULL, 3] | [1, 3, 5] | [1, NULL, 3, 5] | -| 2 | [NULL, NULL, 2] | [2, NULL, 4] | [NULL, 2, 4] | -| 3 | NULL | [1, 2, 3] | NULL | -+------+-----------------+--------------+-------------------------+ +## Parameters -mysql> select k1,k2,k3,array_union(k2,k3) from array_type_table_varchar; -+------+----------------------------+----------------------------------+---------------------------------------------------+ -| k1 | k2 | k3 | array_union(`k2`, `k3`) | -+------+----------------------------+----------------------------------+---------------------------------------------------+ -| 1 | ['hello', 'world', 'c++'] | ['I', 'am', 'c++'] | ['hello', 'world', 'c++', 'I', 'am'] | -| 2 | ['a1', 'equals', 'b1'] | ['a2', 'equals', 'b2'] | ['a1', 'equals', 'b1', 'a2', 'b2'] | -| 3 | ['hasnull', NULL, 'value'] | ['nohasnull', 'nonull', 'value'] | ['hasnull', NULL, 'value', 'nohasnull', 'nonull'] | -| 4 | ['hasnull', NULL, 'value'] | ['hasnull', NULL, 'value'] | ['hasnull', NULL, 'value'] | -+------+----------------------------+----------------------------------+---------------------------------------------------+ +| Parameter | Description | +|--|--| +| `<array1>` | The array to be merged | +| `<array2>` | The array to be merged | Review Comment: 写一个 `<array>` 就可以了 ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-union.md: ########## @@ -24,61 +24,38 @@ specific language governing permissions and limitations under the License. --> -## array_union -array_union +## Description -### description +Merge multiple arrays without duplicate elements to generate a new array -#### Syntax - -`ARRAY<T> array_union(ARRAY<T> array1, ARRAY<T> array2)` - -Returns an array of the elements in the union of array1 and array2, without duplicates. If the input parameter is null, null is returned. - -### example +## Syntax +```sql +ARRAY_UNION(<array1>, <array2>) Review Comment: ```suggestion ARRAY_UNION(<array> [, <array> ] ) ``` ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/countequal.md: ########## @@ -24,54 +24,38 @@ specific language governing permissions and limitations under the License. --> -## countequal -countequal +## Description -### description +Determine the number of value elements in the array -#### Syntax - -`BIGINT countequal(ARRAY<T> arr, T value)` - -Returns a number of the `value` in the given array. +## Syntax -``` -num - how many the value number in array; -0 - if value does not present in the array; -NULL - when array is NULL. +```sql +COUNTEQUAL(<arr>, <value>) ``` -### example +## Parameters -``` -mysql> select *, countEqual(c_array,5) from array_test; -+------+-----------------+--------------------------+ -| id | c_array | countequal(`c_array`, 5) | -+------+-----------------+--------------------------+ -| 1 | [1, 2, 3, 4, 5] | 1 | -| 2 | [6, 7, 8] | 0 | -| 3 | [] | 0 | -| 4 | NULL | NULL | -+------+-----------------+--------------------------+ +| Parameter | Description | +|--|--| +| `<arr>` | The array to be judged | +| `<value>` | Elements to be judged | Review Comment: 这个说明不太明确 ########## docs/sql-manual/sql-functions/scalar-functions/array-functions/array-zip.md: ########## @@ -22,34 +22,38 @@ specific language governing permissions and limitations under the License. --> -## array_zip -array_zip +## Description -### description +Merges all arrays into a single array. The resulting array contains corresponding elements from the source arrays, grouped in the order of the argument list. -Combines all all arrays into a single array. The resulting array contains the corresponding elements of the source arrays grouped into structs in the listed order of arguments. +## Syntax -#### Syntax +```sql +ARRAY_ZIP(<array1>, <array2>) +``` -`Array<Struct<T1, T2,...>> array_zip(Array<T1>, Array<T2>, ...)` +## Parameters -#### Returned value +| Parameter | Description | +|--|--| +| `<array1>` | The array to be merged | +| `<array2>` | The array to be merged | 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org