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

Clickhouse: how to use `Data Skipping Indexes` and `Manipulations With Data Skipping Indices` features in clickhouse?

I'm using the Data Skipping Indexes feature in clickhouse and i got confused about its usage. If i add a data skip index when i create the table like this: CREATE TABLE MyTable ( ... INDEX index_time TimeStamp TYPE minmax GRANULARITY…
Rujiang Ding
  • 103
  • 2
  • 6
7
votes
1 answer

How to implement `pivot` in clickhouse just like in dolphindb

I want to do some pivot ops to some data. Just like following. >>> df = pd.DataFrame({'foo': ['one', 'one', 'one', 'two', 'two', ... 'two'], ... 'bar': ['A', 'B', 'C', 'A', 'B', 'C'], ... …
yjhmelody
  • 119
  • 1
  • 2
  • 4
7
votes
4 answers

Replacement for row_number() in clickhouse

Row_number () is not supported by clickhouse database, looking for a alternate function. SELECT company_name AS company, DOMAIN, city_name AS city, state_province_code AS state, country_code AS country, …
Divyarao
  • 113
  • 2
  • 2
  • 5
7
votes
1 answer

Is 'distinct' an ordinary operation for ClickHouse?

I would like to use ClickHouse for marketing. Most of the time they not just want to know HOW much people use some feature but the exact emails to send spam to. Is that a good choice to use ClickHouse for such purpose (select DISTINCT email from…
Eugene To
  • 1,890
  • 2
  • 19
  • 30
7
votes
5 answers

Select only rows with max date

In clickhouse table I have multiple rows for one _id. What I want is to get only one row for each _id where column _status_set_at has its max value. That's what I am currently at: SELECT _id, max(_status_set_at), count(_id) FROM…
Graygood
  • 363
  • 1
  • 3
  • 18
7
votes
2 answers

Understanding clickhouse partitions

I see that clickhouse created multiple directories for each partition key(in each node). Documentation says the directory name format is : partition ID_minimum block number_maximum block number_level. Any idea what is level here? 347 distinct…
dsr301
  • 759
  • 3
  • 7
  • 21
7
votes
2 answers

Clickhouse altering materialized view's select

I have following setup: CREATE TABLE IF NOT EXISTS request_income_buffer ( timestamp UInt64, timestamp_micro Float32, traceId Int64, host String, type String, service String, message String, caller String, context…
Sergey Shcherbin
  • 391
  • 3
  • 13
7
votes
1 answer

Clickhouse, column values to array

I want to make a query then turn the values for each of it's columns into arrays, I've tried finding a way to do this, but until now it has alluded me. The query is a simple select: SELECT a,b,c FROM X Instead of the usual result of say (in the…
George
  • 3,521
  • 4
  • 30
  • 75
7
votes
3 answers

Change column name in a table in Clickhouse

Is there any way to ALTER a table and change the column name in clickhouse? I only found to change tha table name but not for an individual column in a straight forward way. Thanks.
Yind
  • 335
  • 3
  • 17
7
votes
3 answers

Clickhouse JDBC driver class name

Has anyone used Spring JDBC with Clickhouse? What is the driver class name? spring.datasource.driver-class-name=
Kin Cheung
  • 870
  • 10
  • 20
7
votes
2 answers

Too many simultaneous queries in clickhouse

Our clickhouse server had several exceptions when running small queries under a peak load: DB::Exception: Too much simultaneous queries. Maximum: 100 Is there a setting to increase this number and what can the increase of this setting cause?
alniks
  • 385
  • 2
  • 4
  • 12
7
votes
4 answers

Clickhouse as time-series storage

I just wonder if ClickHouse can be used for storing time-series data in the case like this: schema with columns: "some_entity_id", "timestamp", "metric1", "metric2", "metric3", ..., "metricN". Where each new column containing metric name can be…
Filipp Shestakov
  • 651
  • 7
  • 17
7
votes
2 answers

How make JOIN table in ClickHouse DB faster?

I have two tables event id os params id sx sy This table have relation 1-1 by id. If execute query select count(*) from (select id from event where os like 'Android%') inner join (select id from params where sx >= 1024) using id they very…
Oleg Khamov
  • 269
  • 1
  • 3
  • 10
7
votes
1 answer

How to create primary keys in ClickHouse

I did found few examples in the documentation where primary keys are created by passing parameters to ENGINE section. But I did not found any description about any argument to ENGINE, what it means and how do I create a primary key. Thanks in…
Yuriy Nazarenko
  • 83
  • 1
  • 1
  • 8
6
votes
2 answers

ClickHouse: Does it make sense to use LowCardinality fields on Uint8 used as Boolean?

LowCardinality fields in ClickHouse are an optimization where the values are dictionary-encoded for faster lookups and smaller storage. As per documentation: The efficiency of using LowCarditality data type depends on data diversity. If a…
xmar
  • 1,729
  • 20
  • 48