ClickHouse

Install clickhouse-server-20.3.8.53 on centos and get a version of 20.4.2.9

我只是一个虾纸丫 提交于 2021-02-11 14:49:16
问题 My origin clickhouse version was 19.14.7.15 . $ clickhouse-client ClickHouse client version 19.14.7.15 (official build). Connecting to localhost:9000 as user default. Connected to ClickHouse server version 19.14.7 revision 54425. And I installed a version of 20.3.8.53 . $ sudo yum install -y clickhouse-server-20.3.8.53 Loaded plugins: fastestmirror, versionlock Loading mirror speeds from cached hostfile Excluding 3 updates due to versionlock (use "yum versionlock status" to show them)

Right way to implement pandas.read_sql with ClickHouse

左心房为你撑大大i 提交于 2021-02-11 14:47:33
问题 Trying to implement pandas.read_sql function. I created a clickhouse table and filled it: create table regions ( date DateTime Default now(), region String ) engine = MergeTree() PARTITION BY toYYYYMM(date) ORDER BY tuple() SETTINGS index_granularity = 8192; insert into regions (region) values ('Asia'), ('Europe') Then python code: import pandas as pd from sqlalchemy import create_engine uri = 'clickhouse://default:@localhost/default' engine = create_engine(uri) query = 'select * from regions

How to extract ascending subsets from the sequence?

你说的曾经没有我的故事 提交于 2021-02-10 11:57:23
问题 I have some data: ┌─id--┬─serial┐ │ 1 │ 1 │ │ 2 │ 2 │ │ 3 │ 3 │ │ 4 │ 1 │ │ 5 │ 3 │ │ 6 │ 2 │ │ 7 │ 1 │ │ 8 │ 2 │ │ 9 │ 3 │ │ 10 │ 1 │ │ 11 │ 2 │ │ 12 │ 1 │ │ 13 │ 2 │ │ 14 │ 3 │ └─────┴───────┘ I want to group by column 'serial' where the group rule is: any ascending subset (like this, 1 -> 2 -> 3) is a group. I expect result: ┌─id--┬─serial┬─group─┐ │ 1 │ 1 │ 1 │ │ 2 │ 2 │ 1 │ │ 3 │ 3 │ 1 │ │ 4 │ 1 │ 2 │ │ 5 │ 3 │ 2 │ │ 6 │ 2 │ 3 │ │ 7 │ 1 │ 4 │ │ 8 │ 2 │ 4 │ │ 9 │ 3 │ 4 │ │ 10 │ 1 │ 5 │ │

How to extract ascending subsets from the sequence?

霸气de小男生 提交于 2021-02-10 11:57:05
问题 I have some data: ┌─id--┬─serial┐ │ 1 │ 1 │ │ 2 │ 2 │ │ 3 │ 3 │ │ 4 │ 1 │ │ 5 │ 3 │ │ 6 │ 2 │ │ 7 │ 1 │ │ 8 │ 2 │ │ 9 │ 3 │ │ 10 │ 1 │ │ 11 │ 2 │ │ 12 │ 1 │ │ 13 │ 2 │ │ 14 │ 3 │ └─────┴───────┘ I want to group by column 'serial' where the group rule is: any ascending subset (like this, 1 -> 2 -> 3) is a group. I expect result: ┌─id--┬─serial┬─group─┐ │ 1 │ 1 │ 1 │ │ 2 │ 2 │ 1 │ │ 3 │ 3 │ 1 │ │ 4 │ 1 │ 2 │ │ 5 │ 3 │ 2 │ │ 6 │ 2 │ 3 │ │ 7 │ 1 │ 4 │ │ 8 │ 2 │ 4 │ │ 9 │ 3 │ 4 │ │ 10 │ 1 │ 5 │ │

How to extract ascending subsets from the sequence?

孤人 提交于 2021-02-10 11:55:35
问题 I have some data: ┌─id--┬─serial┐ │ 1 │ 1 │ │ 2 │ 2 │ │ 3 │ 3 │ │ 4 │ 1 │ │ 5 │ 3 │ │ 6 │ 2 │ │ 7 │ 1 │ │ 8 │ 2 │ │ 9 │ 3 │ │ 10 │ 1 │ │ 11 │ 2 │ │ 12 │ 1 │ │ 13 │ 2 │ │ 14 │ 3 │ └─────┴───────┘ I want to group by column 'serial' where the group rule is: any ascending subset (like this, 1 -> 2 -> 3) is a group. I expect result: ┌─id--┬─serial┬─group─┐ │ 1 │ 1 │ 1 │ │ 2 │ 2 │ 1 │ │ 3 │ 3 │ 1 │ │ 4 │ 1 │ 2 │ │ 5 │ 3 │ 2 │ │ 6 │ 2 │ 3 │ │ 7 │ 1 │ 4 │ │ 8 │ 2 │ 4 │ │ 9 │ 3 │ 4 │ │ 10 │ 1 │ 5 │ │

How to search the string in query with case insensitive on Clickhouse database?

孤者浪人 提交于 2021-02-08 17:22:38
问题 I am developing site using PHP and backend ClickHouse database. When i using like queries , it is not supporting case-sensitive words. select id,comments from discussion where comments LIKE "%Data not reflect%"; Is there any way to search case-insensitive words? 回答1: There's no ILIKE operator. I think you can use lowerUTF8() . select id,comments from discussion where lowerUTF8(comments) LIKE '%Data not reflect%'; However, might be performance heavy as it will have to convert all comments

clickhouse merge one partition at a time

爱⌒轻易说出口 提交于 2021-02-08 11:22:20
问题 How do I force ClickHouse to only merge one partition at a time when I run optimize table **** final (without specifying partition 201304 and then 201305 and running it sequentilly) ? I am using a CollapsingMergeTree. Its using a lot of RAM to do multiple merges together for many partitions and killing the service/machine. 回答1: The main problem of optimize final (table or partition does not matter) that it re-writes/re-merges a partition fully even if partition have only 1 part which is

Superset for Clickhouse in docker with SQLAlchemy

扶醉桌前 提交于 2021-02-07 09:13:17
问题 I'm trying to setup Apache Superset for Clickhouse. My understanding so far is that I need to install SQLAlchemy for Clickhouse https://github.com/xzkostyan/clickhouse-sqlalchemy I'm in Ubuntu 16.04 LTS, and using the Docker vanilla version of Clickhouse and of Superset: https://store.docker.com/community/images/yandex/clickhouse-server https://hub.docker.com/r/amancevice/superset/ without special settings Any idea how I can bridge the two docker containers with clickhouse-sqlalchemy ? Where

Superset for Clickhouse in docker with SQLAlchemy

旧城冷巷雨未停 提交于 2021-02-07 09:12:15
问题 I'm trying to setup Apache Superset for Clickhouse. My understanding so far is that I need to install SQLAlchemy for Clickhouse https://github.com/xzkostyan/clickhouse-sqlalchemy I'm in Ubuntu 16.04 LTS, and using the Docker vanilla version of Clickhouse and of Superset: https://store.docker.com/community/images/yandex/clickhouse-server https://hub.docker.com/r/amancevice/superset/ without special settings Any idea how I can bridge the two docker containers with clickhouse-sqlalchemy ? Where

ClickHouse JSON parse exception: Cannot parse input: expected ',' before

别等时光非礼了梦想. 提交于 2021-02-05 08:34:06
问题 I'm trying to add JSON data to ClickHouse from Kafka. Here's simplified JSON: { ... "sendAddress":{ "sendCommChannelTypeId":4, "sendCommChannelTypeCode":"SMS", "sendAddress":"789345345945"}, ... } Here's the steps for creating table in ClickHouse, create another table using Kafka Engine and creating MATERIALIZED VIEW to connect these two tables, and also connect CH with Kafka. Creating the first table CREATE TABLE tab ( ... sendAddress Tuple (sendCommChannelTypeId Int32,