MySQL
See a detailed description of the CREATE TABLE query.
The table structure can differ from the original MySQL table structure:
- Column names should be the same as in the original MySQL table, but you can use just some of these columns and in any order.
host:port
— MySQL server address.database
— Remote database name.table
— Remote table name.user
— MySQL user.replace_query
— Flag that convertsINSERT INTO
queries to . Ifreplace_query=1
, the query is substituted.on_duplicate_clause
— TheON DUPLICATE KEY on_duplicate_clause
expression that is added to theINSERT
query.Example:
INSERT INTO t (c1,c2) VALUES ('a', 2) ON DUPLICATE KEY UPDATE c2 = c2 + 1
, whereon_duplicate_clause
isUPDATE c2 = c2 + 1
. See the to find which you can use with theON DUPLICATE KEY
clause.
Simple WHERE
clauses such as are executed on the MySQL server.
The rest of the conditions and the LIMIT
sampling constraint are executed in ClickHouse only after the query to MySQL finishes.
Table in ClickHouse, retrieving data from the MySQL table created above: