-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Description
Implement the following function:
array_split_into_chunks(array(T), int) -> array(array(T))¶
Returns an array of arrays splitting the input array into chunks of given length. The last chunk will be shorter than the chunk length if the array’s length is not an integer multiple of the chunk length. Ignores null inputs, but not elements.
SELECT array_split_into_chunks(ARRAY [1, 2, 3, 4], 3); – [[1, 2, 3], [4]] SELECT array_split_into_chunks(null, null); – null SELECT array_split_into_chunks(array[1, 2, 3, cast(null as int)], 2]); – [[1, 2], [3, null]]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request