https://blog.youkuaiyun.com/vagabond6/article/details/79622639
- 建表
MergeTree和Log引擎是clickhouse常见的两种引擎,以Log为例:
create table default.user(
uid UInt32,ceil String,qq String,age UInt32,birthday String,
height Float32,is_married Float32,
duration_of_menstruation UInt32,menstrual_cycle UInt32,
star_sign UInt32,weight Float32,province String,
city String,recipient String,recip_ceil String) engine=Log;
- 导入
clickhouse-client --query "insert into default.user format CSV" < user_pro.csv
- jdbc一键导入
mysql数据表可以直接导入clickhouse,如下:
CREATE TABLE user_pro
ENGINE = MergeTree
order by uid as
select * from mysql('lee:port', 'meiyou', 'user_pro', 'root', 'gitgitgit')