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
6
votes
1 answer

How to change PARTITION in clickhouse

version 18.16.1 CREATE TABLE traffic ( `date` Date, ... ) ENGINE = MergeTree(date, (end_time), 8192); I want to change as PARTITION BY toYYYYMMDD(date) without drop table how to do that.
wyx
  • 3,334
  • 6
  • 24
  • 44
6
votes
2 answers

Sqlalchemy shows "Code 516 Authentication failed" when trying to connect to clickhouse db

I have connected to a clickhouse db with dbeaver and installed sqlalchemy v1.3.13 and clickhouse-sqlalchemy 0.1.3 for python 3.7. When I tried to connect with from sqlalchemy import create_engine engine_clickhouse =…
Steve.Gao
  • 177
  • 3
  • 11
6
votes
1 answer

Is ClickHouse Durable?

I know that ClickHouse does not have ACID, therefore I don't expect it to have Durability in terms of ACIDness. But, the question is, is there a possibility to lose inserts if the server crashes?
ramazan polat
  • 7,111
  • 1
  • 48
  • 76
6
votes
2 answers

Clickhouse: is there any way to drop multi-partition in one `alter table drop partition ****` query?

In clickhouse, the table is partitioned by day. Now I want to drop multi-partition in one alter query for convenience. I've done this by shell using while loop: while [[ $startDate < $endDate ]] do clickhouse-client --query="alter table db.table…
Alexander
  • 523
  • 5
  • 21
6
votes
2 answers

Return clickhouse array as column

Is it possible with Clickhouse to have result containing a pair of array transformed as columns? Form this result: ┌─f1──┬f2───────┬f3─────────────┐ │ 'a' │ [1,2,3] │ ['x','y','z'] │ │ 'b' │ [4,5,6] │ ['x','y','z']…
crak
  • 1,635
  • 2
  • 17
  • 33
6
votes
1 answer

clickhouse - how get count datetime per 1minute or 1day ,

I have a table in Clickhouse. for keep statistics and metrics. and structure is: datetime|metric_name|metric_value I want to keep statistics and limit number of accesses in 1 minute, 1 hour, 1 day and so on. So I need event counts in last minute,…
aziminia
  • 449
  • 1
  • 5
  • 15
6
votes
2 answers

Filtering results from ClickHouse using values from dictionaries

I'm a little unfamiliar with ClickHouse and still study it by trial and error. Got a question about it. Talking about the star scheme of data representations, with dimensions and facts. Currently, I keep everything in PostgreSQL, but OLAP queries…
Ilya Konyukhov
  • 2,666
  • 1
  • 12
  • 21
6
votes
2 answers

Clickhouse: how to convert date to long integer?

I have date as a string field in form of '2018-01-02 12:12:22', what is the right way to convert it to long int timestamp in ClickHouse SQL?
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
6
votes
1 answer

How to add a column in clickhouse

I have a table in clickhouse, say "my_table", which has replicates (my_table_rep1,...). And I need to add a column, of type float64, with default value (-1). How should I do that? I would prefer that the default are not actually added to existing…
Juh_
  • 14,628
  • 8
  • 59
  • 92
6
votes
1 answer

ClickHouse Kafka Performance

Following the example from the documentation: https://clickhouse.yandex/docs/en/table_engines/kafka/ I created a table with Kafka Engine and a materialized view that pushes data to a MergeTree table. Here the structure of my tables: CREATE TABLE…
SplitXor
  • 165
  • 1
  • 10
6
votes
1 answer

How does one properly edit the clickhouse-server config.xml file?

The ClickHouse quick start guide says that when modifying config.xml: "It's not really handy to directly edit config.xml file considering package updates. Recommended way is to override the config elements in files of config.d directory." I am new…
Peter
  • 73
  • 1
  • 3
6
votes
3 answers

Clickhouse Data Import

I created a table in Clickhouse: CREATE TABLE stock ( plant Int32, code Int32, service_level Float32, qty Int32 ) ENGINE = Log there is a data file :~$ head -n 10…
dtmp
  • 474
  • 1
  • 5
  • 14
5
votes
0 answers

OPTIMIZE FINAL of a large partition blocked a GET_PART operation and prevented a node from accepting queries

I ran into the scenario in the title on this cluster: 5 shards, 5 replicas Google Cloud Compute One table only on the cluster (sharded and replicated) with ReplicatedReplacingMergeTree. I can provide the schema if needed, but the issue should not…
fpacifici
  • 523
  • 2
  • 11
5
votes
1 answer

Check if clickhouse is healthy docker-compose

I need to wait for Clickhouse to start before I can start my backend server, however the healthcheck does not work. Here is my docker-compose.yml file: version: '3.9' services: server: build: . depends_on: clickhouse: …
5
votes
1 answer

How to delete duplicate rows in SQL ( Clickhouse)?

so I created a table using clickhouse, but it has duplicates in it. The following query gives me the duplicates in my table select *, count() AS cnt from my_table GROUP BY * HAVING cnt > 1 In clickhouse apparently you need do this through…
Dude
  • 366
  • 5
  • 19