Skip to content

send query events from the SELECT part of CREATE OR REPLACE TABLE query#87247

Merged
tuanpach merged 7 commits intoClickHouse:masterfrom
Diskein:progress-bar-on-create-or-replace-with-select
Nov 12, 2025
Merged

send query events from the SELECT part of CREATE OR REPLACE TABLE query#87247
tuanpach merged 7 commits intoClickHouse:masterfrom
Diskein:progress-bar-on-create-or-replace-with-select

Conversation

@Diskein
Copy link
Copy Markdown
Contributor

@Diskein Diskein commented Sep 17, 2025

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

You can see a progress bar, logs and performance statistics for CREATE OR REPLACE TABLE queries with SELECT in clickhouse-client. This query will no longer lead to timeout even if the SELECT is quite time consuming. Resolves #38416

Details

The SELECT section might take a lot of time, so let's:

  • Send progress, logs, and stats for this query
  • Avoid firing TCP session receive timeouts
  • Make this query cancellable

Resolves #38416

…. SELECT ...'

The SELECT section might take a lot of time, so let's:
- Send progress, logs, and stats for this query
- Avoid firing TCP session receive timeouts
- Make this query cancellable
@Diskein
Copy link
Copy Markdown
Contributor Author

Diskein commented Sep 17, 2025

The PR resolves #38416

@tuanpach tuanpach added the can be tested Allows running workflows for external contributors label Sep 18, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Sep 18, 2025

Workflow [PR], commit [2b31be1]

Summary:

job_name test_name status info comment
Stateless tests (amd_ubsan, parallel) failure
02177_issue_31009 FAIL cidb, flaky
Integration tests (amd_asan, old analyzer, 3/6) failure
test_s3_access_headers/test.py::test_custom_access_header[test_access_over_custom_header] FAIL cidb, flaky
Integration tests (amd_binary, 5/5) failure
test_s3_access_headers/test.py::test_custom_access_header[test_access_over_custom_header] FAIL cidb, flaky
Integration tests (arm_binary, distributed plan, 4/4) failure
test_s3_access_headers/test.py::test_custom_access_header[test_access_over_custom_header] FAIL cidb, flaky
Integration tests (amd_tsan, 3/6) failure
test_s3_access_headers/test.py::test_custom_access_header[test_access_over_custom_header] FAIL cidb, flaky

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Sep 18, 2025
@tuanpach
Copy link
Copy Markdown
Member

There is an error:

/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/src/Interpreters/executeQuery.h:89:6: error: function 'DB::executeTrivialBlockIO' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name,-warnings-as-errors]
   89 | void executeTrivialBlockIO(BlockIO & streams, ContextPtr context, bool with_interactve_cancel = false);
      |      ^
/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/src/Interpreters/executeQuery.cpp:2162:6: note: the definition seen here
 2162 | void executeTrivialBlockIO(BlockIO & streams, ContextPtr context, bool with_interactive_cancel)
      |      ^
/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/src/Interpreters/executeQuery.h:89:6: note: differing parameters are named here: ('with_interactve_cancel'), in definition: ('with_interactive_cancel')
   89 | void executeTrivialBlockIO(BlockIO & streams, ContextPtr context, bool with_interactve_cancel = false);
      |      ^                                                                 ~~~~~~~~~~~~~~~~~~~~~~
      |                                                                        with_interactive_cancel

@Diskein Diskein force-pushed the progress-bar-on-create-or-replace-with-select branch from 2b37ba3 to 2790cc7 Compare September 19, 2025 08:24
@tuanpach tuanpach self-assigned this Sep 20, 2025
@Diskein Diskein force-pushed the progress-bar-on-create-or-replace-with-select branch from 2790cc7 to 133d637 Compare September 21, 2025 20:59
@Diskein Diskein force-pushed the progress-bar-on-create-or-replace-with-select branch from 133d637 to 8331530 Compare September 22, 2025 08:25
@Diskein Diskein marked this pull request as draft September 22, 2025 14:42
@Diskein Diskein force-pushed the progress-bar-on-create-or-replace-with-select branch from 4288b6b to c7a1c57 Compare September 23, 2025 18:25
@Diskein Diskein force-pushed the progress-bar-on-create-or-replace-with-select branch from c7a1c57 to a792b9b Compare September 23, 2025 18:38
@Diskein
Copy link
Copy Markdown
Contributor Author

Diskein commented Sep 24, 2025

@Diskein Diskein marked this pull request as ready for review September 24, 2025 08:45
@Diskein Diskein requested a review from tuanpach September 24, 2025 10:14
@Diskein
Copy link
Copy Markdown
Contributor Author

Diskein commented Oct 3, 2025

Thank you @tuanpach for updating the branch!

The failures aren't related to the changes:

@tuanpach
Copy link
Copy Markdown
Member

@tuanpach
Copy link
Copy Markdown
Member

tuanpach commented Nov 11, 2025

@Diskein I merged master into your branch as there were some conflicts.

Could you help double-check?

@Diskein
Copy link
Copy Markdown
Contributor Author

Diskein commented Nov 11, 2025

@Diskein I merged master into your branch as there were some conflicts.

Could you help double-check?

Yep, it looks good to me.

I've seen your changes in which you replaced an optional to a shared_ptr and used weak_ptrs for checking if callbacks use a valid query state. I'm a little bit worried about other callbacks in TCPHandler too. it's maybe just a matter of time when somebody reuses them or/and their query context.

@tuanpach
Copy link
Copy Markdown
Member

t's maybe just a matter of time when somebody reuses them or/and their query context.

You are right. I will have a separate PR to fix other callbacks.

@tuanpach tuanpach added this pull request to the merge queue Nov 12, 2025
Merged via the queue into ClickHouse:master with commit 88bc05c Nov 12, 2025
125 of 131 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No progress bar for CREATE ... AS SELECT

4 participants