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

clickhouse select request with shifting filter

need some help) I have simple request: SELECT uniq(DeviceId) from events where EventDateTime between '2020-12-28 00:00:00' and '2020-12-28 23:59:59' Now, i need to find the same result with one hour shift: SELECT uniq(DeviceId) …
0
votes
0 answers

parsing error while inserting date in ClickHouse using JDBC prepared statement

I have following table in CH: ( msisdn UInt64, time_stamp DateTime64(3, 'Europe/Moscow'), user_id UInt64, imsi String, iccid Nullable(UInt64) ) engine = MergeTree() PARTITION BY toYYYYMM(time_stamp) …
0
votes
1 answer

Can I restore database clickhouse with help binary dump file?

I have docker container with clickhouse database. And I have backups from our production. But I tried many cases with restore. When I using command (in container): clickhouse-client --format Raw --file 21_02_04_db.backup, I get error Bad arguments:…
Gnom Skull
  • 119
  • 1
  • 7
0
votes
0 answers

Comparing Cached and Hashed dictionary

I'm trying to compare Cached and Hashed Clickhouse Dictionaries. What are some of the use cases for both, and where they overlap in strengths what are some queries I could launch to compare them?
0
votes
1 answer

How to use map datatype in clickhouse? How to turn on experimental features?

I am trying to create a table with map datatype in clickhouse but it is giving this error. query: CREATE TABLE table_map (a Map(String, UInt64)) ENGINE=Memory; Received exception from server (version 21.3.4): Code: 44. DB::Exception: Received from…
0
votes
1 answer

Analysis of the completeness of the availability of products from the ClickHouse SQL database

Documentation: https://clickhouse.tech/docs/en/ Goal: 85% of the brand's product range should be available for purchase Calculate the number of products of each brand by availability (maxItems > 0) Make a breakdown of brands by the availability of…
Chegevara
  • 63
  • 4
0
votes
0 answers

clickhouse:SYSTEM STOP MERGES does not work

In factally,I want to use SYSTEM STOP MERGES TABLE to stop merge and then migrate some parts to another shard. My operation as follow: 1. clickhouse-client -q "insert into DTDB.lineorder_demo FORMAT CSV" < lineorder.tbl; I execute SYSTEM STOP…
Bubble Li
  • 1
  • 2
0
votes
0 answers

Rewriting recursive CTE from SQL Server to Clickhouse

As far as I know Clickhouse doesn't support recursive CTEs, so I'd like to rewrite a query that I'm using on SQL Server. Below there's the snippet :) WITH cte (ID, ID_PARENT, OBJ_DESC, CHILD, PARENT, CLASS_NAME, CATEGORY_NAME, LEVEL) AS ( …
0
votes
1 answer

Is there any way to do clickhouse index and partition analysis

In my limited experience with ClickHouse,I need analysis table's indexes and partitions is there any way to get clickhouse's queries of using what index and what partition? Thanks in advance.
bill
  • 5
  • 3
0
votes
1 answer

Is it possible to pass query parameters in the request body for Clickhouse's http interface?

According to the docs, the Clickhouse's http interface allows me to pass query parameters in a query string like this: First, I can write a query with a parameter: SELECT * FROM foo WHERE id = {id:text} This query is passed in the body request, and…
hlustosa
  • 348
  • 1
  • 2
  • 12
0
votes
1 answer

Is there any table where I can find all table indexes in clickhouse?

I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.Now, I can get all table indexes by parsing create_table_query filed,is there any table that directly stores indexs info,like MySQL…
bill
  • 5
  • 3
0
votes
1 answer

How to match chinese characters in Clickhouse

I tried to extract chinese characters from a string using clickhouse SQL. I use: select extractAll('dkfdfjsd1234中文字符串', '[a-zA-Z]') It could successfully returns: ['d','k','f','d','f','j','s','d'] Now I want to extract chinese like that, I…
song.xiao
  • 179
  • 9
0
votes
0 answers

ClickHouse ALTER TABLE DELETE Exception Code 241

I'm having a problem on ALTER TABLE DELETE. I tried to execute ALTER DELETE with various max_block_size (8192, 4096, 2048, 1024). Also tried to change merge_max_block_size of the table (8192, 4096, 2048, 1024). No luck. Full exception text: SQL…
0
votes
1 answer

Does clickhouse offers any tool like red gate sql toolbelt

I would like to compare two clickhouse databases and generate an upgrade script which I can apply for out of date databases. For SQL server I know tool called Red Gate toolbelt which does this job. Is there any product which can do exactly same for…
AmarjeetY
  • 31
  • 3
0
votes
1 answer

passing java string variable in clickhouse query

for example public void invoke(String value, SinkFunction.Context context) throws SQLException { statement_.execute("INSERT INTO test (column_1) VALUES '"+value"'); } how to rightly insert value?
stackover
  • 15
  • 4