Questions tagged [clickhouse]

ClickHouse is an open-source column-oriented DBMS for real time analytical reporting which has Capability to store and process petabytes of data.

ClickHouse is an open-source column-oriented database management system that allows generating analytical data reports in real time.

1835 questions
4
votes
1 answer

FILTER WHERE at count in ClickHouse

I'm trying to migrate one of my Postgres tables at ClickHouse. Here what I came up with at ClickHouse: CREATE TABLE loads( country_id UInt16, partner_id UInt32, is_unique UInt8, ip String, created_at DateTime ) ENGINE=MergeTree…
James May
  • 1,371
  • 3
  • 20
  • 37
4
votes
1 answer

Clickhouse: larger files seem to be kicking a buffer and diagnostic issue?

I'm working with the clickhouse docker image on windows docker desktop 10: https://hub.docker.com/r/yandex/clickhouse-server/ I have got the container up and running and am loading in data. I am running into this issue where CH complains about…
LoF10
  • 1,907
  • 1
  • 23
  • 64
4
votes
3 answers

Clickhouse: How to take incremental backup of Clickhouse db, for both partitoned and unpartitioned tables?

Need to take the backup of Clickhouse DB, Some of the tables are partitioned and some are not. If possible please provide some script or code for better understanding.
Demonoid
  • 41
  • 1
  • 3
4
votes
2 answers

Clickhouse import data from csv DB::NetException: Connection reset by peer, while writing to socket

I'm trying to load *.gz file to Clickhouse through: clickhouse-client --max_memory_usage=15323460608 --format_csv_delimiter="|" --query="INSERT INTO tmp1.my_test)table FORMAT CSV" I"m getting the error: Code: 210. DB::NetException: Connection reset…
Arnon Rodman
  • 511
  • 2
  • 6
  • 21
4
votes
1 answer

HOW to SELECT data basing on both a period of date and a period of time in clickhouse

I want to filter some data by both yyyymmdd(date) and hhmmss(time), but clickhouse don't support time type. So I choose datetime to combine them. But how to do such things: This is code of dolphindb(which supports second type to represent hhmmss.…
yjhmelody
  • 119
  • 1
  • 2
  • 4
4
votes
1 answer

ClickHouse create temporary table

I have an issue when I am trying to create a temporary table in ClickHouse. I execute simple query and get an error create TEMPORARY TABLE nn1 as select 1; message: Code: 113, e.displayText() = DB::Exception: There is no session, e.what() =…
Nik
  • 7,114
  • 8
  • 51
  • 75
4
votes
2 answers

Clickhouse select last record without max() on all table

I have a few billions rows in table for 4k mutable params and I need to get last values for 500 of them My table is partitioned by day and order by param ids so i need just to find last record with needed id SELECT max(time) FROM…
Artem Gusev
  • 43
  • 1
  • 1
  • 7
4
votes
2 answers

How to do pagination in clickhouse

Can you please suggest how can I do pagination in click house? Dor example in elastic search I do aggregation query like below. Here elastic search takes parameters partition number and partition size and give the result. Let's say in total we have…
4
votes
2 answers

Top N rows by group in ClickHouse

What is the proper way to query top N rows by group in ClickHouse? Lets take an example of tbl having id2, id4, v3 columns and N=2. I tried the following SELECT id2, …
jangorecki
  • 16,384
  • 4
  • 79
  • 160
4
votes
2 answers

Clickhouse moving average

Input: Clickhouse Table A business_dttm (datetime) amount (float) I need to calculate moving sum for 15 minutes (or for last 3 records) on each business_dttm For example amount business_dttm moving sum 0.3 2018-11-19 13:00:00 0.3 2018-11-19…
4
votes
1 answer

Starting clickhouse-server in docker fails with error from Poco

I'm trying to start clickhouse-server using the official docker container. I pulled the latest one, tried starting it and receive the following error: Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Not found: logger, e.what() = Not…
Dmitry Smirnov
  • 462
  • 8
  • 22
4
votes
1 answer

Clickhouse - Cumulative Sum or Running Total and Percent to Total

We have been very encouraged by Clickhouse. However, as we are trying to port all of our existing scripts to Clickhouse, we are running into few roadblocks. For example: CUMULATIVE SUM or RUNNING TOTAL. We are trying to find an equivalent of Window…
cag
  • 41
  • 1
  • 1
  • 4
4
votes
1 answer

Is it possible in clickhouse to store a HyperLogLog / uniqState() state directly trough an insert query?

We can use an AggregatedMergeTree table engine, which can be used for a aggregating rows. Generally in aggregated data we are not interested in storing all unique identifiers and still want to do a count distinct. Still we want to have the ability…
RoyB
  • 3,104
  • 1
  • 16
  • 37
4
votes
3 answers

How to make ClickHouse count() function return 0 in case of zero matches?

Our task is to run a batch of ~20000 queries in ClickHouse and store results into a CSV file. Each query is a count() aggregation returning a single number. We do it like this: ./generate_queries.js | clickhouse-client --multiquery | tr '\n' ',' >>…
weekens
  • 8,064
  • 6
  • 45
  • 62
4
votes
2 answers

Checksum doesn't match: corrupted data.: while reading column `cid` at /opt/clickhouse//data/click

I am using clickhouse to store data, and I'm getting the following error while querying the column cid from the click table. Checksum doesn't match: corrupted data. I don't have any replicate for now, any suggestions for recovery?
Tyler.z.yang
  • 2,402
  • 1
  • 18
  • 31