什么是clikhouse:

https://www.jianshu.com/p/350b59e8ea68

clickhouse优缺点:

https://blog.csdn.net/lovewebeye/article/details/102739939

个人使用到的clickhouse相关操作:

1、创建表(clickhouse不支持换行)

CREATE TABLE 数据库名.表名 (`id` UInt16, `port` String, `create` Date) ENGINE = MergeTree(create, id, 8192); 

2、远程导入mysql数据并新建表

CREATE TABLE 表名 ENGINE = MergeTree ORDER BY id AS SELECT * FROM mysql('ip:端口', '数据库', '表名', '用户名', '密码') as a where a.id in (1,2,3,4);

3、导出csv文件

clickhouse-client --query="select * from 表名 format CSV">/home/root1/a.csv;(非数据库内执行)

4、时间戳转时间

select toDateTime(timestamp);

5、导入csv

cat 1.csv | clickhouse-client --query="INSERT INTO 表名 FORMAT CSV";

相关文章:

  • 2021-05-27
  • 2021-10-28
  • 2021-06-02
  • 2020-07-17
  • 2022-12-23
  • 2021-03-01
  • 2021-10-23
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2022-02-05
  • 2021-07-14
  • 2022-02-10
  • 2021-05-29
相关资源
相似解决方案