v.20.3Improvement

Implement arraySlice for Aggregate Function States to Fix Issues #9388 and #9391

Implement arraySlice for arrays with aggregate function states. This fixes #9388 #9391 (alexey-milovidov)
Added support for the arraySlice function to work with arrays containing aggregate function states.

Why it matters

This feature resolves the issue where arraySlice could not handle arrays of aggregate function states, enabling users to perform slicing operations on such arrays. It improves functionality when working with states of aggregate functions stored in arrays, providing more flexibility in aggregation scenarios.

How to use it

Users can now directly apply arraySlice to arrays composed of aggregate function states in their queries without encountering errors. For example, slicing an array of aggregate states can be done using:

SELECT arraySlice(aggregate_states_array, start_index, length) FROM ...