generateRandom
Generates random data with given schema. Allows to populate test tables with data. Not all types are supported.
Arguments
name
— Name of corresponding column.TypeName
— Type of corresponding column.random_seed
— Specify random seed manually to produce stable results. If NULL — seed is randomly generated.max_string_length
— Maximum string length for all generated strings. Defaults to10
.max_array_length
— Maximum elements for all generated arrays or maps. Defaults to10
.
Returned Value
A table object with requested schema.
Usage Example
In combination with generateRandomStructure:
With missing structure
argument (in this case the structure is random):
With random seed both for random structure and random data:
Note: generateRandom(generateRandomStructure(), [random seed], max_string_length, max_array_length)
with large enough max_array_length
can generate really huge output due to possible big nesting depth (up to 16) of complex types (Array
, Tuple
, Map
, Nested
).