Questions tagged [clickhouse-go]

Golang SQL database driver for Yandex ClickHouse.

21 questions
3
votes
2 answers

Clickhouse : import data having double quotes escaped by backslash

I am trying to import a html snippet which is part of one of the column in csv. There are double quotes in the html snippet and its is escaped. this csv is created using apache spark. for illustrating the issue i have just created 2 columns with…
Shivakumar ss
  • 653
  • 7
  • 19
2
votes
1 answer

Post Context deadline exceeded (Client.Timeout exceeded while awaiting headers)

I am running a simple query using Clickhouse HTTP Interface package main import ( "fmt" "net/http" "time" ) func main() { url := "http://localhost:8123" + "?query=select%201" req, _ := http.NewRequest("Post", url, nil) // set…
Zunnurain Badar
  • 920
  • 2
  • 7
  • 28
2
votes
2 answers

Getting lot of "DB::NetException: Connection reset by peer, while reading from socket" errors that are creating lot of noise

I am running click house version '20.6.4' with default settings.While walking through the logs i found these logs in abundance. ServerErrorHandler: Code: 210, e.displayText() = DB::NetException: Connection reset by peer, while reading from…
Tomyhill
  • 79
  • 1
  • 2
  • 10
2
votes
1 answer

Unexpected behaviour for saving the value in decimal column in clickhouse

When save the value (0.0003) in decimal column (Decimal(12,4)) in Clickhouse, the saved value was 0.0002. Why is it behaved like this? But when I did insert by SQL directly, I was able to save it without a problem. Which means, the go program that I…
user3321541
  • 221
  • 1
  • 16
1
vote
1 answer

Scanning sum() of Decimal type with Go, sqlx, ClickHouse

I have a "Duration" field of type Decimal(38, 3) in a ClickHouse table. From my Golang service I'm sending a query to get the SUM() of it but I just can't scan the result back. I tried using int, uint, float, sql.NullFloat64, a struct type, scanning…
1
vote
1 answer

Choose an SQL driver at runtime in Golang when drivers have the same name

I'd like to know if there is an approach or projection pattern to be able to choose SQL driver at runtime in Golang when both of these drivers have the same name. I want to switch between HTTP ClickHouse driver…
Denis Shebut
  • 11
  • 1
  • 3
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 - SELECT row of data is too slow

The following problem occurred in our project, which we cannot solve. We have a huge data of our logs, and we go to ClickHouse from MongoDB. Our table is created like this: CREATE TABLE IF NOT EXISTS logs ON CLUSTER default ( raw …
1
vote
1 answer

How to change order of composed primary key in clickhouse efficiently

I have a table with schema CREATE TABLE traffic ( date Date, val1 UInt64, 'val2' UInt64 ... ) ENGINE = ReplicatedMergeTree(date, (val1, val2), 8192); the partition key is date here. I want to change the order from (val1, val2) to (val2, val1) I only…
Tomyhill
  • 79
  • 1
  • 2
  • 10
1
vote
2 answers

Multi data center for Clickhouse

Does clickhouse Multi Master or multi data center set up support? Any other solutions for multi data center replication for clickhouse?
user3383468
  • 151
  • 1
  • 1
  • 6
0
votes
1 answer

Clickhouse async insert settings implementation

How to correctly using async insert settings in clickhouse? I am following the documentation on clickhouse website here: https://clickhouse.com/docs/en/optimize/asynchronous-inserts to use async inserts. I wanted to apply async insert settings at…
0
votes
1 answer

Reproducing ClickHouse Client CLI query result format using Golang ClickHouse library

Clickhouse CLI result When performing a query using the clickhouse-client command line interface and setting the format as JSON, we not only obtain the result but also statistics. Command clickhouse-client --password=test --user=default…
calebeaires
  • 1,972
  • 1
  • 22
  • 34
0
votes
1 answer

Clickhouse: Want to extract data from Array(Nested) column in Clickhouse

Query used to create the table: CREATE TABLE default.ntest2( job_name String, list_data Array(Nested(s UInt64, e UInt64, name String)) ) ENGINE = MergeTree ORDER BY (job_name) SETTINGS index_granularity = 8192; Table…
0
votes
1 answer

Clickhouse: Want to extract data from Array(Tupple) column in Clickhouse

Query used to create the table: CREATE TABLE default.ntest2(job_name String, list_data Array(Tuple(s UInt64, e UInt64, name String))) ENGINE = MergeTree ORDER BY (job_name) SETTINGS index_granularity = 8192; Table…
0
votes
1 answer

playtika.testcontainers Error creating bean with name 'embeddedClickHouse'

I am trying to run tests using playtika.testcontainers embedded-clickhouse, which used to work, but now I am getting java.lang.IllegalStateException: Failed to load ApplicationContext, caused by Caused by:…
user2329454
  • 153
  • 2
  • 3
  • 7
1
2