ClickHouse/docs/en/functions/random_functions.rst

18 lines
747 B
ReStructuredText
Raw Normal View History

2017-04-26 19:16:38 +00:00
Functions for generating pseudo-random numbers
2017-04-03 19:49:50 +00:00
----------------------
2017-04-26 19:16:38 +00:00
Non-cryptographic generators of pseudo-random numbers are used.
2017-04-03 19:49:50 +00:00
2017-04-26 19:16:38 +00:00
All the functions accept zero arguments or one argument.
If an argument is passed, it can be any type, and its value is not used for anything.
The only purpose of this argument is to prevent common subexpression elimination, so that two different instances of the same function return different columns with different random numbers.
2017-04-03 19:49:50 +00:00
rand
~~~~
2017-04-26 19:16:38 +00:00
Returns a pseudo-random UInt32 number, evenly distributed among all UInt32-type numbers.
Uses a linear congruential generator.
2017-04-03 19:49:50 +00:00
rand64
~~~~
2017-04-26 19:16:38 +00:00
Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers.
Uses a linear congruential generator.