No data about SELECT queries in Superset in ClickHouse table system.processes #28007
Description
Bug description
In ClickHouse there is a table system.processes which contains info about all queries running right now. And we can kill any too long query.
See:
https://clickhouse.com/docs/en/operations/system-tables/processes
https://clickhouse.com/docs/en/sql-reference/statements/kill#kill-query
https://clickhouse.com/docs/en/operations/system-tables/query_log
This table works great. I can run any long (>5sec) query any type (select, insert, update, delete, alter) then I can see that query in system.processes and kill that query by query_id. I checked this functionality in DBeaver. Also I tested that in Superset / SQLLab. All queries running in SQLLab I can see in system.processes except of SELECT queries. I want to see all queries from Superset, not only ins/upd/del but also SELECT queries.
How to reproduce the bug
- Connect ClickHouse DB to Superset.
- Open DBeaver and on current ClickHouse DB create table with a lot of data. Execute SQL code below:
create table eso.t2(v String) ENGINE = MergeTree() order by v
insert into eso.t2(v) values(generateUUIDv4())
insert into eso.t2(v) SELECT v from eso.t2 -- repeat that row 20+ times to have 1m+ rows in table eso.t2 - Open Superset/SQLLab, select UI LIMIT: 1m+ and run long query:
SELECT v, generateUUIDv4() as uid from eso.t2 limit 500000 - In DBeaver on current ClickHouse DB run query:
SELECT query, * FROM system.processes where query not like '%processes%' - There are no rows returned by query. This is the BUG. Exprected result: returned one row from system.processes with query from point 3.
Success case: I run in Superset query: "insert into eso.t2(v) SELECT v from eso.t2" and can see that query in system.processes.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.