v.22.10New Feature

Added Random Generation Functions for Various Distributions

Added functions (randUniform, randNormal, randLogNormal, randExponential, randChiSquared, randStudentT, randFisherF, randBernoulli, randBinomial, randNegativeBinomial, randPoisson) to generate random values according to the specified distributions. This closes #21834. #42411 (Nikita Mikhaylov).
Added functions to generate random values based on various statistical distributions, including uniform, normal, log-normal, exponential, chi-squared, Student's t, Fisher's F, Bernoulli, binomial, negative binomial, and Poisson distributions.

Why it matters

These new functions enable users to simulate and generate random data that follows specific probability distributions directly within ClickHouse queries. This is useful for testing, data simulation, statistical analysis, and probabilistic modeling without external tools.

How to use it

Use the provided functions such as randUniform, randNormal, randLogNormal, randExponential, randChiSquared, randStudentT, randFisherF, randBernoulli, randBinomial, randNegativeBinomial, and randPoisson as scalar functions in SQL queries to generate random samples according to their respective distributions. For example:

SELECT randNormal(0, 1) AS normal_sample FROM numbers(10);