generateRandom Table Function
Generates random data with a given schema. Allows populating test tables with that data. Not all types are supported.
Syntax
Arguments
Argument | Description |
---|---|
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 to 10 . |
max_array_length | Maximum elements for all generated arrays or maps. Defaults to 10 . |
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 a large enough max_array_length
can generate a really huge output due to possible big nesting depth (up to 16) of complex types (Array
, Tuple
, Map
, Nested
).