Categories:
Miscellaneous Functions (Data Generation)

RANDOM

Returns a random sequence of 64-bit integers.

Syntax

RANDOM([seed])

Usage Notes

RANDOM implements a 64-bit Mersenne twister known as MT19937-64.

The optional seed argument must be an integer constant. If no value for seed is provided, a random seed is chosen in a platform-specific manner. Even if a value for seed is provided, the generated sequence is only fully deterministic if execution is serial (single-threaded). This is for the same reasons that the SEQ functions are not fully deterministic in parallel execution.

Examples

SELECT random(4711) FROM table(generator(rowCount => 5));

----------------------+
     random(4711)     |
----------------------+
 -3581185414942383166 |
 1570543588041465562  |
 -6684111782596764647 |
 -3878722496384921389 |
 -1136601514902083621 |
----------------------+