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).
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 asrandUniform, 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);