snuyanzin commented on code in PR #19873:
URL: https://github.com/apache/flink/pull/19873#discussion_r1153853228
##########
docs/data/sql_functions.yml:
##########
@@ -617,6 +617,12 @@ collection:
- sql: ARRAY_DISTINCT(haystack)
table: haystack.arrayDistinct()
description: Returns an array with unique elements. If the array itself is
null, the function will return null. Keeps ordering of elements.
+ - sql: ARRAY_APPEND(haystack, element)
+ table: haystack.arrayAppend(needle)
+ description: Appends an element to the end of the array and returns the
result. If the array itself is null, the function will return null. If an
element to add is null, the null element will be added to the end of the array.
The given element is cast implicitly to the array's element type if necessary.
+ - sql: ARRAY_PREPEND(element, haystack)
+ table: haystack.arrayPrepend(needle)
+ description: Appends an element to the beginning of the array and returns
the result. If the array itself is null, the function will return null. If an
element to add is null, the null element will be added to the beginning of the
array. The given element is cast implicitly to the array's element type if
necessary.
Review Comment:
depends on what you call obvious.
just look at functions a.g.
```sql
SELECT ARRAY_PREPEND(1, ARRAY[2, 3, 4]);
```
In this case at's obviously that the result will be `ARRAY[1, 2, 3, 4]`
in case of spark
```sql
SELECT ARRAY_PREPEND(ARRAY[2, 3, 4], 1);
```
it is not that obvious...
well, i see more engines follow the second option. Probably will do same
just because of majority
--
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]