Datagen connector
The Datagen connector generates rows of random or sequential data. It is a source only, and it needs no external system. Use it to try out Cloudera SQL Stream Builder, or to test a query with generated data.
Example
The connector works without mandatory properties other than connector.
When a column has no settings, Datagen fills it with random values of the type of the
column.
CREATE TABLE orders_gen (
order_id INT,
amount DOUBLE,
order_time AS LOCALTIMESTAMP
) WITH (
'connector' = 'datagen',
'rows-per-second' = '5',
'fields.order_id.kind' = 'sequence',
'fields.order_id.start' = '1',
'fields.order_id.end' = '100000',
'fields.amount.min' = '1',
'fields.amount.max' = '500'
);
Properties
| Property | Description |
|---|---|
connector | datagen |
rows-per-second | The number of rows per second. The default is 10000. |
number-of-rows | The total number of rows. By default, the table is unbounded. |
fields.<column>.kind | random or sequence. The default is random. |
fields.<column>.min and fields.<column>.max | The range of a random number column. |
fields.<column>.start and fields.<column>.end | The range of a sequence column. |
fields.<column>.length | The length of a string, array, map, or multiset column. The default is 100. |
For the full list of options, see DataGen SQL connector in the Apache Flink documentation.
