Repository navigation
Native Common Virtuals for RabbitMQ - #101411
Merged
Merged
Conversation
Contributor
|
Workflow [PR], commit [c9608f8] Summary: ❌
AI ReviewSummaryThis PR adds the Missing context
Findings
Tests
ClickHouse Rules
Final Verdict
|
rienath
reviewed
Apr 1, 2026
Michicosun
commented
Apr 1, 2026
Contributor
LLVM Coverage Report
Changed lines: 45.83% (11/24) · Uncovered code |
rienath
approved these changes
Apr 2, 2026
lilredbot
pushed a commit
to JTCunning/ClickHouse
that referenced
this pull request
Nov 4, 2026
…og sources Since the "native common virtuals" series (ClickHouse#101138 for Kafka, ClickHouse#101411 for RabbitMQ, ClickHouse#101139 for NATS, ClickHouse#101006 for FileLog) the streaming sources fill the `_table` virtual column inside the per-row (NATS: per-message) loop with `getStorageID().getTableName()`. `IStorage::getStorageID()` locks the table-wide `id_mutex` and copies the `StorageID`, and all reader-place virtuals are materialized for every row whether or not the query selects `_table`, so every consumer thread of one table took the same mutex for every row and consumers of one table serialized on it (ClickHouse#120032). The Kafka, StorageKafka2 and RabbitMQ dead-letter branches did the same once per failed message. Take one `StorageID` snapshot plus a `Field` with the table name before the consume loop and fill `_table` / the dead-letter element from it. A block now carries the table name read when the block started, which is the identity `streamToViews` inserts the block under. Measured with a bpftrace uprobe on `IStorage::getStorageID` while a materialized view drains the table: calls made by the source function itself go from one per row (100000 for 100000 Kafka / StorageKafka2 / FileLog rows, 20000 for 20000 NATS / RabbitMQ rows) to one per block (2-8 for Kafka, StorageKafka2, FileLog and NATS; 261-371 for RabbitMQ, which drains in small blocks). The existing virtual-column tests now also check `_table` for Kafka (both engines), RabbitMQ, NATS and FileLog. Closes ClickHouse#120032 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Part of #100766
Version info
26.4.1.517