v.23.2New Feature
Add corrMatrix, covarSampMatrix, and covarPopMatrix Aggregate Functions
AddcorrMatrixaggregate function, calculating each two columns. In addition, since AggregatefunctionscovarSampandcovarPopare similar tocorr, I addcovarSampMatrix,covarPopMatrixby the way. @alexey-milovidov closes #44587. #44680 (FFFFFFFHHHHHHH).
Why it matters
This feature allows users to efficiently calculate correlation and covariance matrices across multiple columns in a single aggregation step, improving convenience and performance when analyzing relationships between multiple variables compared to computing pairwise statistics individually.How to use it
Use the new aggregate functions in your queries as follows:SELECT corrMatrix(column1, column2, ...)
FROM table;
SELECT covarSampMatrix(column1, column2, ...)
FROM table;
SELECT covarPopMatrix(column1, column2, ...)
FROM table;These functions aggregate over the specified columns and return matrices representing correlation or covariance respectively.