Closed Dolso closed 8 months ago
Hi Andrei, and thank you for the report!
22.8.9.24
There was panic in chdig - fixed in https://github.com/azat/chdig/commit/92a13281e42014ad0b9c962e69b205d54b7f5bfc, and now it works.
You can use latest release - https://github.com/azat/chdig/releases/tag/latest
I've also tested 21.8 and it has some bug in ClickHouse that does not allow to use WINDOW functions.
21.2.9.41
It has too old representation of system.query_log
, and I'm pretty sure that it will have the same bug with WINDOW functions.
So to make it work this logic should be moved out from SQL query...
Thanks a lot for the quick response! I tested a bit on clickhouse version 22.8.9.24 and I think the tool works. I think the issue can be closed
Actually it does not solves the issue completely, but #34 will
P.S. I don't use "ancient" (older then ~3month) versions, so I do not test on them, but if it will not require tons of code I'm OK with supporting older versions. And patches are always welcome!
Good afternoon!
I have a question, for which minimum version of clickhouse is the tool supported? Actually version 22.8.9.24 is more interesting than 21.2.9.41
If we look at these two versions separately:
22.8.9.24
The tool manages to work only for a few seconds and then closes (Attached screenshot). Judging by system.query_log, chdig has time to make only one query (successful) (added query below the screenshot) and its query_duration_ms is about 29 ms
21.2.9.41
The tool runs 2 queries at some intervals that cannot execute due to syntax or because some columns are missing in the old version of clickhouse
First query:
Exception:
Code: 47, e.displayText() = DB::Exception: Missing columns: 'ProfileEvents' 'current_database' 'Settings' while processing query: 'SELECT if(is_initial_query, sumMap(ProfileEvents) OVER (PARTITION BY initial_query_id), ProfileEvents) AS ProfileEvents, Settings, thread_ids, peak_memory_usage, elapsed / 1 AS elapsed, user, count() OVER (PARTITION BY initial_query_id) AS subqueries, is_initial_query, initial_query_id, query_id, hostName() AS host_name, current_database, now64() - elapsed AS query_start_time_microseconds, toValidUTF8(query) AS original_query, normalizeQuery(query) AS normalized_query FROM system.processes LIMIT 10000', required columns: 'peak_memory_usage' 'user' 'Settings' 'thread_ids' 'is_initial_query' 'initial_query_id' 'current_database' 'ProfileEvents' 'query' 'query_id' 'elapsed' (version 21.2.9.41 (official build))
Second query:
Exception:
My device "Mac mini": CPU Apple M1 Memory 16 GB macOS Ventura 13.4
Software: chdig 0.6.1 cargo 1.75.0 PyOxidizer 0.24.0 nfpm 2.35.1
Thank you very much in advance! And I apologise if this question is too obvious or has been asked before