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
5
votes
2 answers

Why does ClickHouse client return multiple tables?

I'm very new to Clickhouse and my first attempts seem to always generate this kind of output for SELECT: :) select * from test SELECT * FROM test ┌─s───┬───i─┐ │ foo │ 123 │ └─────┴─────┘ ┌─s───┬───i─┐ │ bar │ 567 │ └─────┴─────┘ I would expect…
lipsumar
  • 944
  • 8
  • 22
5
votes
2 answers

Clickhouse: how to find indexed field in clickhouse SQL?

I have existing table in ClickHouse. I want to find which field is an index field. How do I do it?
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
5
votes
5 answers

creating db and tables in a dockerized Clickhouse instance from docker-compose file

My requirement is to create DB and Tables in Clickhouse when I'm bringing it up using docker-compose. If it is mysql, I do it as below : mysql_1: image: mysql:5.7.16 environment: MYSQL_DATABASE: "one" MYSQL_USER:…
smaikap
  • 474
  • 1
  • 7
  • 19
5
votes
3 answers

Clickhouse running diff with grouping

General Task A table consists of three columns (time, key, value). The task is to calculate a running difference for each key. So, from input --------------- | time | key | value | --------------- | 1 | A | 4 | | 2 | B | 1 | | 3 …
5
votes
2 answers

Replication queue got stuck on error

I've 3 node cluster with replication 2 and the replicated table stats. Recently saw that there is a delay on the replica db using /replica_satatus db.stats: Absolute delay: 0. Relative delay: 0. db2.stats: Absolute delay: 912916. Relative delay:…
wedi
  • 51
  • 3
5
votes
4 answers

Unexpected packet from server localhost:9000, ::1

I have installed clickhouse as per the instructions here https://github.com/Altinity/clickhouse-rpm-install. I have also enabled :: in /etc/clickhouse-server/config.xml. It started fine as below: sudo /etc/init.d/clickhouse-server restart Start…
dsr301
  • 759
  • 3
  • 7
  • 21
5
votes
3 answers

Importing from MySQL dump to Clickhouse

I want to import from MySQL dump to Clickhouse. I've tried going through the official docs but cannot find anything. I've tried importing using CSV following Stack Overflow answer. Any help appreciated. I've an Ubuntu 16.04 LTS.
Niyanta
  • 473
  • 1
  • 9
  • 15
5
votes
2 answers

Why floating point representation are discouraged in ClickHouse tables?

The documentation is not really explaining the behavior of the Float32 and Float64 and why they are discouraged. I'm asking this question because I'm seeing strange behavior when using theses with console cli requests or Rest requests. Float values…
crak
  • 1,635
  • 2
  • 17
  • 33
4
votes
1 answer

Clickhouse UDF not passing argumnets as expected

I've created UDF in Clickhouse, for example: create function test_function AS (in_param) -> (select col1 from table1 t1 join table2 t2 on t1.key=t2.key where t1.key = in_param); It works fine when I try the following example, just passing the…
Josiptl
  • 41
  • 1
4
votes
2 answers

Substraction DateTime64 from DateTime64 in SQL clickhouse BD

I trying to find to calculate time difference in milliseconds betweent timestamps of two tables. like this, SELECT value, (table1.time - table2.time) AS time_delta but i get error : llegal types DateTime64(9) and DateTime64(9) of arguments of…
ditrauth
  • 111
  • 8
4
votes
1 answer

Change Source Directory in Clickhouse

I'm trying to change /var/lib/clickhouse to something like /mnt/sdc/clickhouse so that i could have clickhouse in another hard disk. I've tried this steps: ‍‍1. Stop Clickhouse 2. Move directory /var/lib/clickhouse to /mnt/sdc/clickhouse 3. Replace…
4
votes
1 answer

Will ordering of multiple groupArray aggregations be consistent with each other?

The docs for the groupArray function warns that Values can be added to the array in any (indeterminate) order.... In some cases, you can still rely on the order of execution. This applies to cases when SELECT comes from a subquery that uses ORDER…
lights
  • 1,034
  • 1
  • 8
  • 22
4
votes
1 answer

ClickHouse - ORDER BY WITH FILL - MONTH interval

I've got a question regarding the FILL WITH function. I need a query grouped by month with empty rows to plot on a graph. I use the FILL WITH function. I have a simple table: CREATE TABLE IF NOT EXISTS fillwith ( `event_timestamp` Datetime64, …
Dimi
  • 279
  • 1
  • 3
  • 11
4
votes
1 answer

can't connect clickhouse db using superset occur ERROR: Could not load database driver: clickhouse

URI String is : clickhouse://gpsec:xxx@xxx:8858/sec docker-compose logs -f -t superset superset_app | 2021-02-02T03:23:36.323066230Z 172.17.0.233 - - [02/Feb/2021 03:23:36] "GET /api/v1/database/_info?q=(keys:!(permissions)) HTTP/1.1"…
Yanpeng
  • 89
  • 2
  • 4
4
votes
1 answer

Clickhouse not scaling CPU linearly beyond 28 threads

I have Clickhouse version: 20.8.7.15 running on Ubuntu 18.04.4 LTS with 56 physical CPU cores (112 logical cores with HT enabled) and 256 GB RAM. I created a MergeTree table which has hourly reporting data and i am trying to run a query which…
guptachirag
  • 131
  • 7