v.18.12New Feature

Added arrayCumSumNonNegative and arrayDifference Functions

Added the arrayCumSumNonNegative and arrayDifference functions. Aleksey Studnev
Introduced new array functions arrayCumSumNonNegative and arrayDifference to perform cumulative sum with non-negative constraint and calculate differences between array elements.

Why it matters

These functions enhance array processing capabilities by allowing users to compute cumulative sums that ignore negative values and to find element-wise differences within arrays, solving the need for advanced array manipulations in queries.

How to use it

Users can call the functions directly in their SQL queries as follows:

SELECT arrayCumSumNonNegative(array) FROM table;
SELECT arrayDifference(array) FROM table;


These functions operate on array-type columns or expressions to return the respective calculations.