Skip to content

Allow external table writes with disable_insertion_and_mutation - #88549

Merged
tavplubix merged 2 commits into
masterfrom
tavplubix-patch-14
Nov 10, 2025
Merged

tavplubix merged 2 commits into
masterfrom
tavplubix-patch-14

Conversation

@tavplubix

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Allow inserting into remote and data lake tables when disable_insertion_and_mutation is enabled

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh

clickhouse-gh Bot commented Oct 14, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [01d436a]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_debug, parallel) failure
01415_sticking_mutations FAIL cidb
Performance Comparison (amd_release, master_head, 1/3) error
Performance Comparison (amd_release, master_head, 2/3) error
Performance Comparison (amd_release, master_head, 3/3) error

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Oct 14, 2025
@kapustor

Copy link
Copy Markdown
Contributor

@tavplubix can we also add insertions into Kafka engine? This is a huge blocker for the DWH team.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests.

&& query.table_id.database_name != DatabaseCatalog::TEMPORARY_DATABASE)
{
throw Exception(ErrorCodes::QUERY_IS_PROHIBITED, "Insert queries are prohibited");
if (!(std::dynamic_pointer_cast<StorageObjectStorage>(table) || table->isDataLake()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ugly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have too many conditions here.
My advice is to have an individual function that returns a bool value, which means if query is allowed
And in the function we can have enough comment to explain why to allow some queries and disallow some

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Check that the documentation is updated before merging.

Inserts into external engines are allowed despite this setting.
@tavplubix
tavplubix marked this pull request as ready for review October 19, 2025 19:31
table->isObjectStorage() || /// S3, Azure, GCS, HDFS, etc.
table->isDataLake() || /// Iceberg, DeltaLake, Hudi
table->isMessageQueue() || /// Kafka, RabbitMQ, NATS
table->isExternalDatabase(); /// MySQL, PostgreSQL, MongoDB, Hive, YTsaurus

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs special clarification about external ClickHouse databases. Otherwise, it looks inconsistent.

It should be approved with synchronous inserts into Distributed tables.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would allow inserting on local replica through Distributed, bypassing the restriction

@tavplubix

Copy link
Copy Markdown
Member Author

Perf tests - Failed to insert data into CI DB
Stateless tests (amd_debug, parallel) - #88858

@tavplubix
tavplubix enabled auto-merge November 10, 2025 13:49
@tavplubix
tavplubix added this pull request to the merge queue Nov 10, 2025
Merged via the queue into master with commit 04e990e Nov 10, 2025
@tavplubix
tavplubix deleted the tavplubix-patch-14 branch November 10, 2025 14:08
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants