Procházet zdrojové kódy

docs: add docs for the newly added funcs (#1930)

Signed-off-by: wangxye <1031989637@qq.com>
Abyss před 1 rokem
rodič
revize
0dd3b81cbe

+ 17 - 6
docs/en_US/sqls/built-in_functions.md

@@ -180,12 +180,23 @@ Currently, 'zlib', 'gzip', 'flate' and 'zstd' method are supported.
 
 
 ## Array Functions
 ## Array Functions
 
 
-| Function       | Example                      | Description                                                                                                                          |
-|----------------|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
-| array_position | array_position(array, value) | Return a 0-based index of the first occurrence of val if it is found within array. If val does not exist within array, it returns -1 |
-| element_at     | element_at(array, index)     | Returns element of array at index val. If val < 0, this function accesses elements from the last to the first                        |
-| array_contains | array_contains(array, value) | Returns true if array contains the element                                                                                           |
-| array_create   | array_create(value1, ......) | Construct an array from literals                                                                                                     |
+| Function            | Example                           | Description                                                                                                                                |
+|---------------------|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| array_position      | array_position(array, value)      | Return a 0-based index of the first occurrence of val if it is found within array. If val does not exist within array, it returns -1       |
+| element_at          | element_at(array, index)          | Returns element of array at index val. If val < 0, this function accesses elements from the last to the first                              |
+| array_contains      | array_contains(array, value)      | Returns true if array contains the element                                                                                                 |
+| array_create        | array_create(value1, ......)      | Construct an array from literals                                                                                                           |
+| array_remove        | array_remove(array, value)        | Returns the array with all occurrences of value removed                                                                                    |
+| array_last_position | array_last_position(array, val)   | Return a 0-based index of the last occurrence of val if it is found within array. If val does not exist within array, it returns -1        |
+| array_contain_any   | array_contain_any(array1, array2) | Returns true if array1 and array2 have any elements in common                                                                              |
+| array_intersect     | array_intersect(array1, array2)   | Returns an intersection of the two arrays, with all duplicates removed                                                                     |
+| array_union         | array_union(array1, array2)       | Returns a union of the two arrays, with all duplicates removed                                                                             |
+| array_max           | array_max(array)                  | Returns an element which is greater than or equal to all other elements of the array. If an element of the array is null, it returns null  |
+| array_min           | array_min(array)                  | Returns an element which is less than or equal to all other elements of the array. If an element of the array is null, it returns null     |
+| array_except        | array_except(array1, array2)      | Returns an array of elements in array1 but not in array2, without duplicates                                                               |
+| repeat              | repeat(val, count)                | Constructs an array of val repeated count times                                                                                            |
+| sequence            | sequence(start, stop[, step])     | Constructs an array from start to stop with each value increasing or decreasing by step. If step is not provided, it defaults to 1 if start is less than stop, or -1 if start is greater than stop. Notice that step is not allowed to be 0 |
+
 
 
 ## Object Functions
 ## Object Functions
 
 

+ 16 - 6
docs/zh_CN/sqls/built-in_functions.md

@@ -180,12 +180,22 @@ eKuiper 具有许多内置函数,可以对数据执行计算。
 
 
 ## 列表函数
 ## 列表函数
 
 
-| 函数             | 示例                           | 说明                                                    |
-|----------------|------------------------------|-------------------------------------------------------|
-| array_position | array_position(array, value) | 返回第二个参数在列表参数中的索引下标位置,索引下标从 0 开始,若该元素不存在,则返回 -1        |
-| element_at     | element_at(array, index)     | 返回列表参数中在给定索引下的元素,索引下标从 0 开始,若该索引小于 0,则该元素从列表末向列表头进行计数 |
-| array_contains | array_contains(array, value) | 返回给定元素是否存在列表参数中,存在则返回 true,否则返回 false                 |
-| array_create   | array_create(value1, ......) | 将给定的元素参数们创建为一个列表元素                                    |
+| 函数                | 示例                              | 说明                                                                                       |
+|---------------------|-----------------------------------|------------------------------------------------------------------------------------------|
+| array_position      | array_position(array, value)      | 返回第二个参数在列表参数中的索引下标位置,索引下标从 0 开始,若该元素不存在,则返回 -1                |
+| element_at          | element_at(array, index)          | 返回列表参数中在给定索引下的元素,索引下标从 0 开始,若该索引小于 0,则该元素从列表末向列表头进行计数    |
+| array_contains      | array_contains(array, value)      | 返回给定元素是否存在列表参数中,存在则返回 true,否则返回 false                                   |
+| array_create        | array_create(value1, ......)      | 将给定的元素参数们创建为一个列表元素                                                           |
+| array_remove        | array_remove(array, value)        | 返回删除了所有出现的给定元素的数组                                                             |
+| array_last_position | array_last_position(array, val)   | 返回第二个参数在列表参数中最后一次出现的下标位置,索引下标从 0 开始,若该元素不存在,则返回 -1          |
+| array_contain_any   | array_contain_any(array1, array2) | 返回两个列表参数中是否存在任何相同元素,存在则返回 true,否则返回 false                            |
+| array_intersect     | array_intersect(array1, array2)   | 返回两个列表参数的交集,且不包含重复元素                                                        |
+| array_union         | array_union(array1, array2)       | 返回两个列表参数的并集,且不包含重复元素                                                        |
+| array_max           | array_max(array)                  | 返回列表参数中的最大值,若数组元素中存在 null,则返回 null                                       |
+| array_min           | array_min(array)                  | 返回列表参数中的最小值,若数组元素中存在 null,则返回 null                                       |
+| array_except        | array_except(array1, array2)      | 返回一个包含第一个列表参数中元素,但不包含第二个列表参数中的元素列表,且不包含重复元素                 |
+| repeat              | repeat(val, count)                | 返回一个由给定元素参数重复出现指定次数的列表元素                                               |
+| sequence            | sequence(start, stop[, step])     | 返回一个从第一个开始参数到第二个结束参数的整数列表,每个元素按照给定的步长递增或递减。若未提供步长,则默认为 1(如果第一个开始参数小于第二个结束参数),或 -1(如果第一个开始参数大于第二个结束参数),且步长不允许为 0 |
 
 
 ## 对象函数
 ## 对象函数