How to Generate Random Data for Clickhouse

HKN MZ
2 min readOct 11, 2022

Sometimes we need test data. So Clickhouse has built-in generateRandom() function that helps quickly generate and populate data into tables of any structure.

Generates random data with given schema. Allows to populate test tables with data. Supports all data types that can be stored in table except LowCardinality and AggregateFunction.

generateRandom('name TypeName[, name TypeName]...', [, 'random_seed'[, 'max_string_length'[, 'max_array_length']]])

--

--

HKN MZ

I am writing about Sql Server, Elasticsearch and Python. İ am an Database Administrator on SQL Server and Elasticsearch more than 5+ years.