Skip to content

Commit 382ba2b

Browse files
authored
minor(docs): Correct array_prepend docs (#13362)
* minor(docs): Correct array_prepend docs * formatted docs with prettier
1 parent bab02b6 commit 382ba2b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/source/user-guide/expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ select log(-1), log(0), sqrt(-1);
228228
| array_pop_back(array) | Returns the array without the last element. `array_pop_back([1, 2, 3]) -> [1, 2]` |
229229
| array_position(array, element) | Searches for an element in the array, returns first occurrence. `array_position([1, 2, 2, 3, 4], 2) -> 2` |
230230
| array_positions(array, element) | Searches for an element in the array, returns all occurrences. `array_positions([1, 2, 2, 3, 4], 2) -> [2, 3]` |
231-
| array_prepend(array, element) | Prepends an element to the beginning of an array. `array_prepend(1, [2, 3, 4]) -> [1, 2, 3, 4]` |
231+
| array_prepend(element, array) | Prepends an element to the beginning of an array. `array_prepend(1, [2, 3, 4]) -> [1, 2, 3, 4]` |
232232
| array_repeat(element, count) | Returns an array containing element `count` times. `array_repeat(1, 3) -> [1, 1, 1]` |
233233
| array_remove(array, element) | Removes the first element from the array equal to the given value. `array_remove([1, 2, 2, 3, 2, 1, 4], 2) -> [1, 2, 3, 2, 1, 4]` |
234234
| array_remove_n(array, element, max) | Removes the first `max` elements from the array equal to the given value. `array_remove_n([1, 2, 2, 3, 2, 1, 4], 2, 2) -> [1, 3, 2, 1, 4]` |

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,23 +3081,23 @@ array_position(array, element, index)
30813081

30823082
### `array_prepend`
30833083

3084-
Appends an element to the end of an array.
3084+
Prepends an element to the beginning of an array.
30853085

30863086
```
3087-
array_append(array, element)
3087+
array_prepend(element, array)
30883088
```
30893089

30903090
#### Arguments
30913091

3092-
- **array**: Array expression. Can be a constant, column, or function, and any combination of array operators.
30933092
- **element**: Element to append to the array.
3093+
- **array**: Array expression. Can be a constant, column, or function, and any combination of array operators.
30943094

30953095
#### Example
30963096

30973097
```sql
3098-
> select array_append([1, 2, 3], 4);
3098+
> select array_prepend(1, [2, 3, 4]);
30993099
+--------------------------------------+
3100-
| array_append(List([1,2,3]),Int64(4)) |
3100+
| array_prepend(Int64(1), List([2,3,4])) |
31013101
+--------------------------------------+
31023102
| [1, 2, 3, 4] |
31033103
+--------------------------------------+

0 commit comments

Comments
 (0)