Skip to content

Support SETTINGS with implicit ENGINE and mixing engine and query settings - #73120

Merged
Algunenano merged 10 commits into
ClickHouse:masterfrom
Algunenano:settings_default_settings
Dec 26, 2024
Merged

Algunenano merged 10 commits into
ClickHouse:masterfrom
Algunenano:settings_default_settings

Conversation

@Algunenano

@Algunenano Algunenano commented Dec 11, 2024 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Support SETTINGS with implicit ENGINE and mixing engine and query settings

You can now use engine settings even if the engine is not declared (default_table_engine)

CREATE TABLE example_table
(
    `id` UInt32,
    `data` String
)
ORDER BY id
SETTINGS max_part_loading_threads = 8

You can also mix table settings and query settings. The server will apply the server settings dynamically to the query and remove them from the table declaration. In case of ambiguity (the setting can be both table and query setting), it will be kept as a table setting:

CREATE TABLE example_table
(
    `id` UInt32,
    `data` JSON
)
ENGINE = MergeTree()
ORDER BY id
SETTINGS async_insert = 1, enable_json_type = 1

Here enable_json_type is applied to the query and the table is created with just async_insert = 1

Closes #73099
Closes #63154

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-poll4 robot-ch-test-poll4 added the pr-improvement Pull request with some product improvements label Dec 11, 2024
@robot-clickhouse

robot-clickhouse commented Dec 11, 2024 •

Copy link
Copy Markdown
Member

This is an automated comment for commit 06d5876 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
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
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✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ 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
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@Algunenano

Copy link
Copy Markdown
Member Author

Need to disambiguate between engine and query settings

@Algunenano
Algunenano marked this pull request as draft December 20, 2024 17:41
@Algunenano
Algunenano force-pushed the settings_default_settings branch 2 times, most recently from c53f1ac to d0be4e7 Compare December 23, 2024 13:52
@Algunenano
Algunenano force-pushed the settings_default_settings branch from d0be4e7 to 358ec90 Compare December 23, 2024 15:41
@Algunenano
Algunenano force-pushed the settings_default_settings branch from cf8186c to 0525509 Compare December 24, 2024 10:28
@Algunenano Algunenano changed the title Support SETTINGS with implicit ENGINE Support SETTINGS with implicit ENGINE and mixing engine and query settings Dec 24, 2024
@Algunenano
Algunenano force-pushed the settings_default_settings branch from d5f5f5a to 05e51c1 Compare December 24, 2024 11:22
@Algunenano
Algunenano marked this pull request as ready for review December 24, 2024 13:09
@Avogar Avogar self-assigned this Dec 24, 2024
Comment thread src/Storages/StorageFactory.h Resolved
@nikitamikhaylov nikitamikhaylov added the 🎅 🎁 gift🎄 To make people wonder label Dec 24, 2024
It makes things more complicated than it needs to be
@Algunenano
Algunenano added this pull request to the merge queue Dec 26, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 26, 2024
@Algunenano
Algunenano added this pull request to the merge queue Dec 26, 2024
Merged via the queue into ClickHouse:master with commit ea78455 Dec 26, 2024
@Algunenano
Algunenano deleted the settings_default_settings branch December 26, 2024 15:34
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 26, 2024
@Algunenano Algunenano mentioned this pull request Jan 7, 2025
23 tasks
github-merge-queue Bot pushed a commit that referenced this pull request Jan 8, 2025
@Algunenano Algunenano assigned divanik and unassigned Avogar Mar 14, 2025
robot-clickhouse added a commit that referenced this pull request Mar 14, 2025
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created-cloud deprecated label, NOOP label Mar 14, 2025
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Mar 14, 2025
robot-ch-test-poll2 added a commit that referenced this pull request Mar 14, 2025
Backport #73120 to 24.12: Support SETTINGS with implicit ENGINE and mixing engine and query settings
robot-clickhouse added a commit that referenced this pull request Mar 17, 2025
robot-ch-test-poll added a commit that referenced this pull request Mar 17, 2025
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jul 2, 2025
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @Algunenano @Avogar — while reviewing this PR I found the following:

Happy to discuss — close anything that's wrong or already addressed.

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

Labels

🎅 🎁 gift🎄 To make people wonder pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud deprecated label, NOOP pr-improvement Pull request with some product improvements pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

Cannot create table with SETTINGS with implicit ENGINE CREATE TABLE AS with SETTINGS should recognize settings for the corresponding ENGINE