long_sequence(iterations)- generates rows.
long_sequence(iterations, seed1, seed2)- generates rows with deterministic randomness.
iterations: is a
long representing the number of rows to generate.
long64 representing both parts of a
long_sequence(iterations) is used to:
- Generate a number of rows defined by
- Generate a column
x:longof monotonically increasing long integers starting from 1, which can be accessed for queries.
do not be afraid to generate very large datasets for your testing e.g billions of rows or more if your disk allows.
Random number seed
long_sequence is used conjointly with random generators, these values are
usually generated at random. It is sometimes useful to generate deterministic datasets which allows to perform testing
on vasts amounts of data without actually moving large files around. Using the same seed on any machine at any time will
consistently produce the same results for all random functions.
- Generating multiple rows
SELECT x, rnd_double() FROM long_sequence(5);
- Accessing row number via
SELECT x, x*x FROM long_sequence(5);
- Using with a seed
SELECT rnd_double() from long_sequence(2,128349234,4327897);
The results below will be the same on any machine at any time as long as they use the same seed in long_sequence.