Skip to content

No data about SELECT queries in Superset in ClickHouse table system.processes #28007

Closed
@berlicon

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

  1. Connect ClickHouse DB to Superset.
  2. 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
  3. Open Superset/SQLLab, select UI LIMIT: 1m+ and run long query:
    SELECT v, generateUUIDv4() as uid from eso.t2 limit 500000
  4. In DBeaver on current ClickHouse DB run query:
    SELECT query, * FROM system.processes where query not like '%processes%'
  5. 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.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions