clickhouse如何删除数据库和创建数据库以及分布式DDL创建数据库

原创 2021-02-25 17:20 阅读(10)次
[秒懂学习ClickHouse,请移步《ClickHouse原理解析与应用实践》](https://union-click.jd.com/jdc?e=&p=AyIGZRprFQEbDlIZXRQyVlgNRQQlW1dCFFlQCxxKQgFHRE5XDVULR0UVARsOUhldFB1LQglGa2F2CHUWYTpSYmZXF0wjfQB2QUtrKFMOHjdVE14UCxUAVhxfJQITBlUTUhYAFgRlK1sUMkRpVRpaFAMTAlQfWCUAEwZXGF0WAxcDZRtcFAQaAFYSWxECEgNlHFscMklXFlMQXVkiN1UYUhwFEAFUK1...

druid执行clickhouse报错:sql injection violation, dbType clickhouse , druid-version 1.2.2, syntax error

原创 2020-12-15 11:45 阅读(461)次
今天遇到一个druid不支持clickhouse的问题,druid执行clickhouse报错:sql injection violation, dbType clickhouse , druid-version 1.2.2, syntax error错误如下: Caused by: java.sql.SQLException: sql injection violation, dbType clickhouse, , druid-version 1.2.2, syntax error: syntax error, error in :'icle r where first_appear_ti...

clickhouse如何删除数据

原创 2020-11-27 18:09 阅读(2460)次
clickhouse删除数据提供了三种方式:一、是删除分区,数据就会删除掉二、是通过Alter语句删除数据三、是还可以通过设置日期字段或表的TTL生命周期,到期自动清除数据注意:上面前2点都可以使用分布式DDL删除集群各节点数据,第三点是创建表时定义的,暂时不提。1.删除分区alter table 表名 drop partition 分区名分区名可以用下语句查询select * from system.parts p where table = '表名'以我下面这张表为例,分区函数是toYYYYMMDD(collect_time),按天分区,那分区名就是20201010这样的日期格式,只要按这...

clickhouse执行查询内存超出限制问题:Memory limit (total) exceeded

原创 2020-11-26 18:15 阅读(962)次
今天用clickhouse执行分布式查询报错:SQL 错误 [241]: ClickHouse exception, code: 241, host: 192.168.29.124, port: 18123; Code: 241, e.displayText() = DB::Exception: Memory limit (total) exceeded: would use 15.44 GiB (attempt to allocate chunk of 4294967296 bytes), maximum: 13.95 GiB (version 20.6.3.28 (official bui...

clickhouse执行分布式DDL报错:Table `xxx` isn't replicated, but shard #2 is replicated according to its

原创 2020-11-17 18:06 阅读(181)次
clickhouse执行分布式DDL报错:Table `xxx` isn't replicated, but shard #2 is replicated according to its cluster definition执行的语句是:alter table engs_comp_clg_result_local on cluster shipin_cluster drop partition 20191101 我是想把我集群shipin_cluster中两个节点的本地表中一个分区删除掉,但是一执行报如上错误,说是我的本地表不是复制表,但是分片2却根据定义在复制。我的集群配置如下:<y...