v.22.11New Feature
Add randCanonical function for pseudo-random value generation in [0, 1)
Add functionrandCanonical, which is similar to therandfunction in Apache Spark or Impala. The function generates pseudo random results with independent and identically distributed uniformly distributed values in [0, 1). #43124 (李扬).
Why it matters
This feature provides users with a reliable way to generate independent and identically distributed uniform random numbers in ClickHouse queries, which is useful for simulations, randomized algorithms, and sampling tasks, enhancing compatibility with functions in other big data platforms.How to use it
Use therandCanonical() function within your SQL queries in ClickHouse to generate pseudo-random floating-point values between 0 (inclusive) and 1 (exclusive). For example: SELECT randCanonical() FROM table