v.23.2New Feature

Add corrMatrix, covarSampMatrix, and covarPopMatrix Aggregate Functions

Add corrMatrix aggregate function, calculating each two columns. In addition, since Aggregatefunctions covarSamp and covarPop are similar to corr, I add covarSampMatrix, covarPopMatrix by the way. @alexey-milovidov closes #44587. #44680 (FFFFFFFHHHHHHH).
Introduces the corrMatrix aggregate function to compute correlation matrices for multiple columns. It also adds covarSampMatrix and covarPopMatrix aggregate functions to calculate covariance matrices analogous to covarSamp and covarPop but for multiple columns simultaneously.

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.