mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
2e1f6bc56d
* replace exit with assert in test_single_page * improve save_raw_single_page docs option * More grammar fixes * "Built from" link in new tab * fix mistype * Example of include in docs * add anchor to meeting form * Draft of translation helper * WIP on translation helper * Replace some fa docs content with machine translation * add normalize-en-markdown.sh * normalize some en markdown * normalize some en markdown * admonition support * normalize * normalize * normalize * support wide tables * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * lightly edited machine translation of introdpection.md * lightly edited machhine translation of lazy.md * WIP on translation utils * Normalize ru docs * Normalize other languages * some fixes * WIP on normalize/translate tools * add requirements.txt * [experimental] add es docs language as machine translated draft * remove duplicate script * Back to wider tab-stop (narrow renders not so well)
1.4 KiB
1.4 KiB
MySQL
MySQL 引擎可以对存储在远程 MySQL 服务器上的数据执行 SELECT
查询。
调用格式:
MySQL('host:port', 'database', 'table', 'user', 'password'[, replace_query, 'on_duplicate_clause']);
调用参数
host:port
— MySQL 服务器地址。database
— 数据库的名称。table
— 表名称。user
— 数据库用户。password
— 用户密码。replace_query
— 将INSERT INTO
查询是否替换为REPLACE INTO
的标志。如果replace_query=1
,则替换查询'on_duplicate_clause'
— 将ON DUPLICATE KEY UPDATE 'on_duplicate_clause'
表达式添加到INSERT
查询语句中。例如:impression = VALUES(impression) + impression
。如果需要指定'on_duplicate_clause'
,则需要设置replace_query=0
。如果同时设置replace_query = 1
和'on_duplicate_clause'
,则会抛出异常。
此时,简单的 WHERE
子句(例如 =, !=, >, >=, <, <=
)是在 MySQL 服务器上执行。
其余条件以及 LIMIT
采样约束语句仅在对MySQL的查询完成后才在ClickHouse中执行。
MySQL
引擎不支持 Nullable 数据类型,因此,当从MySQL表中读取数据时,NULL
将转换为指定列类型的默认值(通常为0或空字符串)。