snuyanzin commented on code in PR #22834: URL: https://github.com/apache/flink/pull/22834#discussion_r1251060837
########## docs/data/sql_functions.yml: ########## @@ -643,6 +643,11 @@ collection: - sql: ARRAY_REVERSE(haystack) table: haystack.arrayReverse() description: Returns an array in reverse order. If the array itself is null, the function will return null. + - sql: ARRAY_SLICE(array, start_offset, end_offset) + table: array.arraySlice(start_offset, end_offset) + description: Returns a subset of the input array, starting from 'start_offset' and ending at 'end_offset'. These offsets are 1-based and can be positive (counted from the start of the array) or negative (counted from the end of the array). If 'start_offset' or 'end_offset' are 0, they are treated + as starting from the beginning of the input array. If 'start_offset' is after 'end_offset' or if the input array is empty, it will return an empty array. If either 'start_offset' or 'end_offset' exceed the array bounds, they are adjusted to the size of the array. Conversely, if the absolute value + of a negative 'start_offset' or 'end_offset'is greater than the size of the array, the corresponding offset is reset to the beginning of the array, which is 1. Returns null if any input is null. - sql: ARRAY_UNION(array1, array2) Review Comment: i have a bit more concise version ``` Returns a subarray of the input array between 'start_offset' and ending at 'end_offset' inclusive. The offsets are 1-based however 0 is also treated as the beginning of the array. Positive values are counted from the beginning of the array while negative from the end. If 'start_offset' is after 'end_offset' an empty array will be returned. If either 'start_offset' or 'end_offset' are out of array bounds, they are adjusted to its bounds. Returns null if any input is null. ``` i guess something could be omitted like `if the input array is empty, it will return an empty array` which is obvious please let me know what you think. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org