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
21
votes
3 answers

Is it possible to delete old records from clickhouse table?

As far as I know, clickhouse allows only inserting new data. But is it possible to delete block older then some period to avoid overflow of HDD?
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
18
votes
6 answers

Updating data in Clickhouse

I went over the documentation for Clickhouse and I did not see the option to UPDATE nor DELETE. It seems to me its an append only system. Is there a possibility to update existing records or is there some workaround like truncating a partition that…
Jonathan
  • 2,183
  • 4
  • 20
  • 25
17
votes
2 answers

Query Clickhouse for currently installed version

I know there's a bunch of system tables. If one has access to those where do I find the currently installed version?
supernova
  • 1,762
  • 1
  • 14
  • 31
15
votes
5 answers

Multiple small inserts in clickhouse

I have an event table (MergeTree) in clickhouse and want to run a lot of small inserts at the same time. However the server becomes overloaded and unresponsive. Moreover, some of the inserts are lost. There are a lot of records in clickhouse error…
alniks
  • 385
  • 2
  • 4
  • 12
13
votes
2 answers

How to setup an admin account for Clickhouse?

I'm running Clickhouse in a docker container on a Windows host. I tried to create an account towards making it an admin account. It looks like the default user does not have permission to create other accounts. How can I get around this error and…
frosty
  • 2,421
  • 6
  • 26
  • 47
12
votes
2 answers

How to avoid duplicates in clickhouse table?

I have created table and trying to insert the values multiple time to check the duplicates. I can see duplicates are inserting. Is there a way to avoid duplicates in clickhouse table? CREATE TABLE sample.tmp_api_logs ( id UInt32, EventDate Date)…
user3383468
  • 151
  • 1
  • 1
  • 6
12
votes
4 answers

How to group by time bucket in ClickHouse and fill missing data with nulls/0s

Suppose I have a given time range. For explanation, let's consider something simple, like whole year 2018. I want to query data from ClickHouse as a sum aggregation for each quarter so the result should be 4 rows. The problem is that I have data…
simPod
  • 11,498
  • 17
  • 86
  • 139
12
votes
2 answers

How to filter clickhouse table by array column contents?

I have a clickhouse table that has one Array(UInt16) column. I want to be able to filter results from this table to only get rows where the values in the array column are above a threshold value. I've been trying to achieve this using some of the…
MoshMcCabe
  • 130
  • 1
  • 3
  • 12
11
votes
1 answer

Clickhouse string field disk usage: null vs empty

I'm designing a schema for a large Clickhouse table with string fields that can be pretty sparse. I'm wondering if these fields should be nullable or if I should store an empty string "" as a default value. Which would be better in terms of storage?
jeffreyveon
  • 13,400
  • 18
  • 79
  • 129
11
votes
2 answers

How understand the granularity and block in ClickHouse?

I am not clear about these two words. Whether does one block have a fixed number of rows? Whether is one block the minimum unit to read from disk? Whether are different blocks stored in different files? Whether is the range of one block bigger than…
GOGO
  • 619
  • 2
  • 7
  • 17
10
votes
1 answer

How to cast date Strings to DateTime format with extended parsing in ClickHouse?

I have a String field with timestamp like this: "2020-01-13T07:34:25.804445Z". And i want to parse it to datetime (to use in Grafana filters, for example). But i getting this error: SELECT SELECT "@timestamp" AS timestamp, CAST(timestamp AS…
DenisNovac
  • 621
  • 2
  • 8
  • 15
10
votes
2 answers

How to have auto increment in ClickHouse?

I want a column to have a unique value in every insertion. In SQL we can have this using autoincrement, in Clickhouse can we have this functionality using any type like auto increment or any other? I am new to Clickhouse so there may be a…
Ankit Juneja
  • 117
  • 1
  • 1
  • 6
10
votes
1 answer

update materialized view with join statement

Suppose I have 2 tables A and B. I create a MV(materialized view) with a join query of two tables, psuedo like: create materialized view a_b engine = Memory as select * from( select * from A ) all inner join ( select * from B ) using…
Thang Nguyen
  • 1,110
  • 8
  • 17
10
votes
3 answers

How to create database in database docker container?

I'm new in docker, so cant understand - if I want to build container of mysql/postgresql/clickhouse etc - how to create database and schema of database/table? Maybe in Dockerfile or i can do it from docker-compose.yml? I mean, that I dont know when…
Den Hm
  • 101
  • 1
  • 1
  • 3
9
votes
2 answers

ClickHouse: How to store JSON data the right way?

I'm going to migrate data from PostgreSQL database to Yandex's ClickHouse. One of the fields in a source table is of type JSON - called additional_data. So, PostgreSQL allows me to access json attributes during e.g. SELECT ... queries with ->> and…
arturkuchynski
  • 790
  • 1
  • 9
  • 27
1
2 3
99 100