Skip to content

Serialize query plan for Distributed queries - #69652

Merged
KochetovNicolai merged 158 commits into
masterfrom
query-plan-serialization-basics
Apr 10, 2025
Merged

KochetovNicolai merged 158 commits into
masterfrom
query-plan-serialization-basics

Conversation

@KochetovNicolai

@KochetovNicolai KochetovNicolai commented Sep 16, 2024 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • New Feature

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

Serialize query plan for Distributed queries. A new setting serialize_query_plan is added. When enabled, queries from Distributed table will use a serialized query plan for remote query execution. This introduces a new packet type to TCP protocol, <process_query_plan_packet>true</process_query_plan_packet> should be added to the server config to allow processing this packet.

Limitations:

  • A local table is required to build a query plan. A distributed table with no local replicas will not work.
  • Cross-replication is not supported.
  • Distributed over distributed support is limited. The inner distributed table will process queries only up to the FetchColumns stage (e.g., it can only read source data but cannot pre-aggregate it).
  • Parallel replicas are not supported (queries may return invalid results).
  • So far, some query plan steps do not support serialization. However, everything covered by Ci is supported.
  • JOIN is supported only with query_plan_use_new_logical_join_step enabled (it's enabled by default).

Comments:

  • The feature is enabled in CI runs for Stateless tests (asan), Stateless tests (debug), and Integration tests (aarch64). Now, they have a distributed plan in the description.
  • I will probably add the setting randomization later.
  • The query plan serialization format is versioned. The current version is 0, and it does not guarantee compatibility between versions so far. Incompatible protocol changes are allowed until the version is increased.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing):

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64, release, debug

  • Run only fuzzers related jobs (libFuzzer fuzzers, AST fuzzers, etc.)
  • Exclude: AST fuzzers

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-feature Pull request with new product feature label Sep 17, 2024
@robot-clickhouse

robot-clickhouse commented Sep 17, 2024 •

Copy link
Copy Markdown
Member

This is an automated comment for commit a7fa981 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here❌ failure
Successful checks
Check nameDescriptionStatus
Docs checkBuilds and tests the documentation✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success

@novikd novikd self-assigned this Sep 17, 2024
@davenger davenger self-assigned this Apr 3, 2025
Comment thread src/Core/ServerSettings.cpp Resolved
Comment thread tests/integration/runner Resolved
Co-authored-by: Alexander Gololobov <[email protected]>
Comment thread src/Server/TCPHandler.cpp Resolved
@KochetovNicolai

Copy link
Copy Markdown
Member Author

Integration tests (asan, flaky check) mainly fails with Table ... already exists error which is unrelated.

CH Inc sync is broken because sync cannot sync the last merge commit. Everything else is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull request with new product feature 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.

6 participants