Creating SQL dumps
Data can be dumped in SQL format using SQLInsert. ClickHouse will write data inINSERT INTO <table name> VALUES(... form and use output_format_sql_insert_table_name settings option as a table name:
output_format_sql_insert_include_column_names option:
some_table table exists in the some_db MySQL database.
Some DBMSs might have limits on how much values can be processes within a single batch. By default, ClickHouse will create 65k values batches, but that can be changed with the output_format_sql_insert_max_batch_size option:
Exporting a set of values
ClickHouse has Values format, which is similar to SQLInsert, but omits anINSERT INTO table VALUES part and returns only a set of values:
Inserting data from SQL dumps
To read SQL dumps, MySQLDump is used:table_from_mysql based on a structure that ClickHouse automatically inferred. ClickHouse either detects types based on data or uses DDL when available: