Skip to content

Commit cb41e92

Browse files
committed
add docs for array_pop_front
Signed-off-by: veeupup <code@tanweime.com>
1 parent e70411a commit cb41e92

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/source/user-guide/expressions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ Unlike to some databases the math functions in Datafusion works the same way as
219219
| flatten(array) | Converts an array of arrays to a flat array `flatten([[1], [2, 3], [4, 5, 6]]) -> [1, 2, 3, 4, 5, 6]` |
220220
| array_length(array, dimension) | Returns the length of the array dimension. `array_length([1, 2, 3, 4, 5]) -> 5` |
221221
| array_ndims(array) | Returns the number of dimensions of the array. `array_ndims([[1, 2, 3], [4, 5, 6]]) -> 2` |
222+
| array_pop_front(array) | Returns the array without the first element. `array_pop_front([1, 2, 3]) -> [2, 3]` |
222223
| array_pop_back(array) | Returns the array without the last element. `array_pop_back([1, 2, 3]) -> [1, 2]` |
223224
| array_position(array, element) | Searches for an element in the array, returns first occurrence. `array_position([1, 2, 2, 3, 4], 2) -> 2` |
224225
| array_positions(array, element) | Searches for an element in the array, returns all occurrences. `array_positions([1, 2, 2, 3, 4], 2) -> [2, 3]` |

docs/source/user-guide/sql/scalar_functions.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,7 @@ from_unixtime(expression)
15151515
- [array_length](#array_length)
15161516
- [array_ndims](#array_ndims)
15171517
- [array_prepend](#array_prepend)
1518+
- [array_pop_front](#array_pop_front)
15181519
- [array_pop_back](#array_pop_back)
15191520
- [array_position](#array_position)
15201521
- [array_positions](#array_positions)
@@ -1867,6 +1868,30 @@ array_prepend(element, array)
18671868
- list_prepend
18681869
- list_push_front
18691870

1871+
### `array_pop_front`
1872+
1873+
Returns the array without the first element.
1874+
1875+
```
1876+
array_pop_first(array)
1877+
```
1878+
1879+
#### Arguments
1880+
1881+
- **array**: Array expression.
1882+
Can be a constant, column, or function, and any combination of array operators.
1883+
1884+
#### Example
1885+
1886+
```
1887+
❯ select array_pop_first([1, 2, 3]);
1888+
+-------------------------------+
1889+
| array_pop_first(List([1,2,3])) |
1890+
+-------------------------------+
1891+
| [2, 3] |
1892+
+-------------------------------+
1893+
```
1894+
18701895
### `array_pop_back`
18711896

18721897
Returns the array without the last element.

0 commit comments

Comments
 (0)