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

Connection reset by peer while uploading large csv in clickhouse

Getting this error while uploading a csv to clickhouse with row count > 2.5M and number of column > 90. code: 210. DB::NetException: Connection reset by peer, while writing to socket (10.107.146.25:9000): data for INSERT was parsed from stdin Here…
Abhinav Raj
  • 117
  • 2
  • 9
3
votes
1 answer

Can ClickHouse convert the string in format 'DD-MMM-YYYY' to Date?

Is there a function like that in clickhouse? Similar to mysql's STR_TO_DATE function. I need to convert '04-Jun-2021' to '2021-06-04'
mo maek
  • 31
  • 1
  • 2
3
votes
1 answer

Get Inner Table Name of Materialized Views with Clickhouse

I have several Tables and materialized views which haven't been created with To [db] statement and have an inner tables with these names: │ .inner_id.27e007b7-d831-4bea-8610-b3f0fd1ee018 │ │ .inner_id.3e27a1eb-f40f-4c6d-bc70-7722f2cc953b │ │…
3
votes
1 answer

ClickHouse: where 0 is Null?

create database test create table test.A (id UInt8, data String) engine MergeTree() order by (id) create table test.B (id UInt8, data String) engine MergeTree() order by (id) insert into test.A values (0,'a'),(1,'b'),(2,'c') insert into test.B…
Alexey Golyshev
  • 792
  • 6
  • 11
3
votes
0 answers

ImportModuleError: no module named 'clickhouse_driver.varint' after upgrade clickhouse-driver

I'm facing with problem when I upgrade clickhouse driver version from 0.0.20 to 0.2.0. My code: from variables import aws as config from clickhouse_driver import Client host = "localhost" port = 9000 user = "root" password = "password" database =…
The Blues
  • 211
  • 1
  • 4
  • 15
3
votes
0 answers

clickhouse : Cannot parse JSON string: expected opening quote: (while read the value of key data): (at row 1): While executing SourceFromInputStream

this error messge: SELECT * FROM queue2 Received exception from server (version 20.9.3): Code: 26. DB::Exception: Received from xxxx:xxxx. DB::Exception: Cannot parse JSON string: expected opening quote: (while read the value of key data): (at row…
Yanpeng
  • 89
  • 2
  • 4
3
votes
1 answer

Clickhouse: calculate a difference between two dates excluding some days (but not the weekends!)

Maybe it's an easy problem, but I can't figure out how to solve it. I'm working on ClickHouse 20.12.5.14. My goal is to get the difference (in minutes) between two datetimes, excluding some days which are configured in a "non-working-days" table.…
Zzzzzz
  • 33
  • 4
3
votes
1 answer

Collecting data from JSON array into ClickHouse table

I have some raw JSON data in ClickHouse table (actually, netflow V9 from netflow collector) it looks like this: {"AgentID":"10.1.8.1", "Header":{"Version":9,"Count":2}, "DataSets":[ …
3
votes
1 answer

Best way to do data rebalancing in Clickhouse

As of now, there's no native support for auto-rebalancing for Clickhouse. Say we need to add new nodes to the Clickhouse cluster and need to do a rebalance to make sure all the data still distributes evenly across all the nodes. Is there any…
clasnake
  • 309
  • 2
  • 9
3
votes
1 answer

How to change users.xml from being readonly?

I've set up a working instance of a ClickHouse server with docker-compose. Right now I'm trying to grant privileges (write permission) to a user who is defined in users.xml as such:
user14628143
3
votes
1 answer

Clickhouse. Create database on cluster ends with timeout

I have a cluster which consists of two nodes of Clickhouse. Both instances are in docker containers. All communications between hosts are successfully checked - ping, telnet, wget works fine. In the Zookeeper I can see my fired queries under the ddl…
3
votes
1 answer

Clickhouse query use regular expression

I know clickhouse provides replaceRegexpOne() function, but I want to use a regular expression to query, not replace. Like MySQL: select username from table where username REGEXP '^[0-9]*$'. Hope you can help me, Thanks.
XiaXiaoHai
  • 43
  • 1
  • 1
  • 3
3
votes
1 answer

How can I find duplicate records in clickhouse

I want to know how I can find duplicate data entries within one table in clickhouse. I am actually investigating on a merge tree table and actually threw optimize statements at my table but that didn't do the trick. The duplicate entries still…
Amanda
  • 194
  • 1
  • 11
3
votes
4 answers

How to get data with JSON format in Clickhouse-driver

I'm trying to get my Clickhouse data in my Django project. I'm using clickhouse_driver and : client.execute('SELECT * FROM myTable LIMIT 5 FORMAT JSON') When I execute this command in my Clickhouse server SELECT * FROM myTable LIMIT 5 FORMAT JSON…
3
votes
0 answers

How to decide the partition key for clickhouse

I want to know what's the best practice for the partition key. In my project, we have a table with event_date, app_id and other columns. The app_id will be growing and could be thousands. The select query is based on event_date and app_id. The…
George Jia
  • 659
  • 6
  • 7