24 questions
0
votes
0
answers
224
views
migrations using clickhouse and testcontainers
everyone!
I have some problems to up my migration files inside clickhouse container
package tests
import (
"context"
"fmt"
_ "github.com/ClickHouse/clickhouse-go&...
0
votes
1
answer
115
views
runningDifference() not working in clickhouse for this serinario
In clickhouse lag/lead functions are not supporting, i used runningDifference(), for this scenario it's not working.
select endtime, runningDifference(endtime) as time_diff
from
(select ...
1
vote
1
answer
293
views
Clickhouse creating view on cluster on non default database fails
I am trying to create a view on a clickhouse server that is ran in docker based on image clickhouse/clickhouse-server:22.8.13.20
I create a table in a database named X (not default), the connection ...
0
votes
0
answers
208
views
Clickhouse asynchronous_insert_log table not visible
asynchronous_insert_log table is not there under system db in clickhouse. My config.xml contains below configuration by default:
<clickhouse>
<!-- Other settings -->
<...
0
votes
1
answer
2k
views
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 ...
0
votes
1
answer
504
views
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-...
0
votes
1
answer
2k
views
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)...
0
votes
1
answer
911
views
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 =...
10
votes
1
answer
50k
views
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" +...
0
votes
1
answer
812
views
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 ...
0
votes
1
answer
351
views
Postgres query convert to clickhouse with conditional count
I need to convert this postgres query to clickhouse:
select count(1) filter (where car_model = 'chevrolet'), count(distinct car_num) filter (where car_model='chevrolet') from cars;
I have tried with ...
1
vote
1
answer
1k
views
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 ...
2
votes
1
answer
2k
views
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 ...
1
vote
0
answers
668
views
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 ...
0
votes
0
answers
142
views
Making sure table/materialized view created before continuing next command on Clickhouse
I'm using clickhouse-go, sometimes when I run create multiple materialized view, then query from those materialized view it shows success, but sometimes failed because the materialized view not yet ...
1
vote
1
answer
4k
views
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 ...
0
votes
0
answers
973
views
clickhouse gives "create user" as syntax error
I have enabled access_management also but when I try show users or create user this is how I'm getting.
3e6af090665c :) show users;
Syntax error: failed at position 6:
show users;
Expected one of: ...
1
vote
1
answer
3k
views
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 ...
0
votes
0
answers
196
views
Clickhouse DB: ReplacingMergeTree ver column is not affected
This is my table's create script
CREATE TABLE IF NOT EXISTS replacing_test (
addr String,
ver UInt64,
stt ...
2
votes
3
answers
7k
views
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: ...
0
votes
0
answers
465
views
Clickhouse downsample into OHLC different time bar intervals
How would you do all kinds of time frames especially time frames where you have gaps in time over 24hr? Like accounting for close/swap on 24hr currency markets or commodities / indexes ?
clickhouse ...
3
votes
2
answers
6k
views
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 ...
3
votes
1
answer
2k
views
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 ...
0
votes
2
answers
1k
views
How initialize the result of groupArray function of the ClickHouse to the array
In my Go application, I make a request to the ClickHouse database via clickhouse-go package. This query which I make return always only one record and it's an array of integers. Is there any way to ...