# Partition array > Supported in: Batch, Streaming Splits an array into consecutive arrays of at most the given size, preserving element order. The size must be a positive integer. Returns null if the array or size is null, or the size is invalid. **Expression categories:** Array ## Declared arguments * **Array:** Array to partition.
*Expression\>* * **Size:** Maximum number of elements in each partition. Must be a positive integer.
*Expression\* **Type variable bounds:** *T accepts AnyType* **Output type:** *Array\>* ## Examples ### Example 1: Base case **Argument values:** * **Array:** \[ a, b, c, d, e ] * **Size:** 2 **Output:** \[ \[ a, b ], \[ c, d ], \[ e ] ] *** ### Example 2: Null case **Argument values:** * **Array:** `array` * **Size:** `size` | array | size | **Output** | | ----- | ----- | ----- | | *null* | 2 | *null* | | \[ 1 ] | *null* | *null* | | \[ 1 ] | 0 | *null* | | \[ 1 ] | -1 | *null* | | \[ ] | 0 | *null* | | \[ 1, *null*, 3 ] | 2 | \[ \[ 1, *null* ], \[ 3 ] ] | *** ### Example 3: Edge case **Argument values:** * **Array:** `array` * **Size:** `size` | array | size | **Output** | | ----- | ----- | ----- | | \[ ] | 2 | \[ ] | | \[ 1, 2 ] | 1 | \[ \[ 1 ], \[ 2 ] ] | | \[ 1, 2, 3, 4 ] | 2 | \[ \[ 1, 2 ], \[ 3, 4 ] ] | | \[ 1, 2, 3 ] | 2 | \[ \[ 1, 2 ], \[ 3 ] ] | | \[ 1, 2 ] | 2 | \[ \[ 1, 2 ] ] | | \[ 1, 2 ] | 2147483647 | \[ \[ 1, 2 ] ] | ***