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

org.apache.http.protocol.HttpRequestExecutor@6ea2bc93 is not serializable. The object probably contains or references non serializable fields

flink consume kafka, sink to clickhouse error at dataStreamSource.addSink(sinkInstance); Exception in thread "main" org.apache.flink.api.common.InvalidProgramException: org.apache.http.protocol.HttpRequestExecutor@6ea2bc93 is not serializable. The…
stackover
  • 15
  • 4
0
votes
1 answer

Multiple arrays Clickhouse

Problem: Count distinct values in an array filtered by another array on same row (and agg higher). Explanation: Using this data: In the Size D70, there are 5 pcs available (hqsize), but shops requests 15. By using the column accumulatedNeed, the 5…
0
votes
1 answer

Clickhouse - Moving Sum in Arrays

I am looking at an efficient way to do a Sum of (n forward-looking array elements) in an array. For e.g. Input -> [1,2,3,4,5,6,7,8] Expected Result (for n = 2) -> [3,5,7,9,11,13,15,8] Similarly if the n=3 then Expected Result ->…
calgs
  • 57
  • 7
0
votes
1 answer

How to realize funnel analysis in ClickHouse

I want to do funnel analysis based on buried point data that are stored in ClickHouse. Let's define a few elements for funnel analysis: A series of events: A (event_id = 1) -> B (event_id = 2) -> C (event_id = 3) Time period: 0 (event_ms) ~ 500…
Pang Fish
  • 11
  • 1
0
votes
1 answer

SQL Query (ClickHouse): group by where timediff between values less then X

I need a little help with sql-query. I'm using clickhouse, but maybe standard SQL syntax is enough for this task. I've got the following table: event_time; Text; ID 2021-03-16 09:00:48; Example_1; 1 2021-03-16 09:00:49; Example_2; 1 2021-03-16…
0
votes
1 answer

How materialized view works in Clickhouse

I am trying to know how MV works when i insert batch with 10000 records. How many times MV will work ? 1 time for all records or 10000 time? And if another client insert in the same time what will happen? Can anyone explain the mechanism. Thanks.
ali
  • 81
  • 3
  • 13
0
votes
0 answers

Optimal primary key on this ClickHouse schema for aggregation

I have a ClickHouse schema as following, MergeTree is in question: ( hotel String, staff_member String, task_number Float64, date DateTime ) PRIMARY KEY (hotel, date) ORDER BY (hotel, date) My aggregation is as following: SELECT staff_member, …
Alek Yo
  • 63
  • 8
0
votes
0 answers

ClickHouse: how to enable performant queries against increasing user-defined attributes

I am designing a system that handles a large number of buried point event. An event record contains: buried_point_id, for example: 1 means app_launch, 2 means user_register. happened_at: the event timestamp. user_id: the user identifier. other…
Pang Fish
  • 11
  • 1
0
votes
1 answer

Clickhouse Batch Execution not inserting new rows

I have just installed a clickhouse server locally, with package clickhouse-server linux package. I created some java code to insert N rows in table and it works well via JDBC. However to improve, performance I am now implementing it using batch…
João Ramiro
  • 312
  • 1
  • 9
0
votes
1 answer

How to query data in a time range from grafana with clickhouse as datasource?

I am trying to get data of "last 5 minutes" which is an option in the above top-down menu in grafana. I have used the $timeFilter variable but when selecting the last 5 minutes, it is returning data of more than 5 minutes and the query being created…
0
votes
1 answer

Calculate bounce rate with Clickhouse

I am trying to use Clickhouse for a small analytics app of mine and I have a table that records raw hits as: CREATE TABLE hits ( sessionId LowCardinality(String), page LowCardinality(String), timestamp DateTime, projectId UInt16 ) ENGINE =…
vorillaz
  • 6,098
  • 2
  • 30
  • 46
0
votes
1 answer

Renaming database with Replicated Table

My Clickhouse database 'CurrDB' contains table with engine type ReplicatedReplacingMergeTree. I renamed this database to NewDB(Moved current tables to NewDB and deleted CurrDB). Now when I tried to recreate same database('CurrDB') again and tried…
0
votes
2 answers

Clickhouse Array Field - Check if ANY of the items meets condition

In my Clickhouse server, I have a table with an Array of Integers field: CREATE TABLE my_table ( ... my_array_field Array(UInt32), ... ) Pretty simple definition. But now I want to filter the records matching a condition like this: Any of…
Mauricio Moraes
  • 7,255
  • 5
  • 39
  • 59
0
votes
0 answers

Why 'A left join B' and 'B right join A' are different in Clickhouse?

I don't care the order of the query result. From relational algebra point of view, these should be the same. The two queries give different results in Clickhouse. Querys: select count(*) from A left join B on A.product_id = B.product_id and A.date =…
0
votes
1 answer

Select data in range from first bad value to last bad value

Have such table and data: create table sensor_values( dt DateTime default now(), value UInt32 ) engine MergeTree() partition by toYYYYMM(dt) order by tuple(); insert into sensor_values(value) values (1), (2), (11), (13), (4), (17), (5),…