Questions tagged [clickhouse-client]

58 questions
5
votes
1 answer

Clickhouse: how to take column's default value when insert data through pandas dataframe and the cell value is null

I am trying to insert a Pandas dataframe into Clickhouse, but encountered some problems. Here is the table schema: CREATE TABLE IF NOT EXISTS test_table ( name String, day DateTime64(3) DEFAULT '2020-07-01 00:00:00', ) engine =…
3
votes
2 answers

Clickhouse Memory Issue

I am having a table with around 2 billion rows that i try to query the max(id) from. Id is not the sort key of the table and the table is using the table engine mergeTree. No matter what I try, I get memory errors. This does not stop with this one…
Thomas Miller
  • 79
  • 2
  • 8
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
2
votes
0 answers

Clickhouse correlated queries/joins with multiple inequalities

I have this query I am trying to join 2 table based on 4 conditions select * from table1 t1 asof left join table2 t2 on t1.start=t2.start and t1.end=t2.end and (t1.spending between t2.spending-10 and t2.spending+10) and (t1.timestamp_ between…
Zunnurain Badar
  • 920
  • 2
  • 7
  • 28
2
votes
1 answer

Clickhouse cannot alter columns throws DB::Exception: Metadata on replica is not up to date with common metadata in Zookeeper

I have a replicated merge tree table on two nodes I have two columns as client_port and server_port Int16, I want to change it to UInt16. There is currently alot of data in this table (somewhere around 1.2TB with 20billion rows) On running these…
Abid Zaidi
  • 357
  • 4
  • 12
1
vote
0 answers

How to conditionally rename or exchange a table?

Is there an equivalent to the T-SQL IF...ELSE keywords for control flow? I'm trying to conditionally EXCHANGE tables A and B if A exists, otherwise just rename B to A. From documentation, all I'm seeing around conditional logic is to use functions…
Switch386
  • 454
  • 6
  • 19
1
vote
1 answer

Growth Book Now Supports ClickHouse - need the installation process for ubuntu server

I have a Growthbook that has already mogo DB integrated and I want to change the database click house because it is fast. please let me know the process of installation of my own domain and also how to create DB and user in click house…
1
vote
1 answer

Clickhouse KILL QUERY hangs forever

Having following potential infinite-time execution query. It does not make sense why it had been issued to Clickhouse server. Query is already has been launched and still running: SELECT Count("SN".*) FROM (SELECT sleepEachRow(3) FROM…
Vladislav Ihost
  • 2,127
  • 11
  • 26
1
vote
1 answer

how can we Batch insert using java clickhouse-client?

Performance of clickhouse-client is far better than clickhouse-jdbc where we do have preparedStatment for batchInsert. But how can we do Batch insert using clickhouse-client. try (ClickHouseClient client =…
usman
  • 1,351
  • 5
  • 23
  • 47
1
vote
0 answers

Clickhouse http interface read Native/RowBinary Format data

Want to get the query statistics info like rows_read/bytes_read for a query. But using the native interface(golang client), it seems impossible. And using Http interface we could get it in the header returned. But using JSON/TabSeparated format, the…
Ling Peng
  • 33
  • 2
1
vote
1 answer

Clickhouse jdbc driver connection issue

We are trying to connect to a clickhouse server using jdbc drivers. Our code snippet is in scala and would not be much different in java import java.util.Properties Class.forName("ru.yandex.clickhouse.ClickHouseDriver") var conn : Connection =…
justlikethat
  • 329
  • 2
  • 12
1
vote
1 answer

Check if a setting was applied with clickhouse-client

How can I check if a cluster setting is applied on server? For example, I run --query "SET allow_experimental_live_view = 1" on my cluster. Which query should I use to check that this setting was changed? Is it possible to do with clickhouse-client…
vitaliis
  • 4,082
  • 5
  • 18
  • 40
0
votes
0 answers

Unable to update async insert settings in clickhouse

I have setup clickhouse server, I have dont following things. Under default user in users.xml have enabled these…
0
votes
0 answers

clickhouse python insert_distributed_sync

I'm getting results that are incomplete when I try to insert into a cluster. But the results are complete when I insert locally. See example below: ClickHouse client version 22.3.6.5 (official build). ##Connection string: connection_string =…
chowpay
  • 1,515
  • 6
  • 22
  • 44
0
votes
0 answers

ClickHouse java client doesn't send all batches

Here are method to send batches to ClickHouse. Batch size = 50, all data to send = 1000 objects. My method void executeBatch(final List batch) throws ClickHouseException { if (!batch.isEmpty()) { try (ClickHouseClient client…
1
2 3 4