v.20.4Improvement

Implemented generateRandom Table Function for Nested Types

Implemented generateRandom table function for Nested types. This closes #9903 #10219 (alexey-milovidov)
generateRandom table function now supports Nested types in ClickHouse.

Why it matters

This feature enables users to generate random data for Nested types, enhancing the ability to create test datasets and perform experiments on complex data structures within ClickHouse. It solves the limitation of previously not supporting Nested types with the generateRandom function, thereby improving testing and development workflows.

How to use it

Use the generateRandom table function specifying a Nested type as the argument. For example:

SELECT * FROM generateRandom(Nested(name String, values Array(UInt32)), 10)


This will generate 10 rows of random data with the specified Nested structure.