Repository navigation
MergeTree Continuous Query - #105114
Merged
Merged
MergeTree Continuous Query#105114
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2d50f53. Configure here.
Contributor
LLVM Coverage Report
Changed lines: 53.51% (618/1155) | lost baseline coverage: 64 line(s) · Uncovered code |
Michicosun
enabled auto-merge
May 27, 2026 09:00
47 of 72 tasks
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):
This patch adds support for continuous query for merge tree tables implemented via a series of snapshot reads. This is a first step toward general support for streaming queries.
Watermarks support is present in the different pr: #106169
Note
High Risk
Introduces an experimental
STREAMtable modifier that changes query parsing/analysis and the MergeTree read pipeline, plus adds new background scheduling and subscription logic; regressions could impact core read paths and schema operations for MergeTree tables.Overview
Adds an experimental continuous-query mode via
FROM t STREAM [CURSOR {...}], including a new parser/AST (ASTStreamSettings) and propagation through analyzerTableExpressionModifiers(with hashing/formatting).Implements MergeTree streaming reads as a snapshot loop:
ReadFromMergeTreeswitches to a newMergeTreeCommitOrderSequentialSourcewhenSelectQueryInfo::isStream()is set, maintains per-partition cursors (CursorTree/CursorUtils), and disables incompatible behaviors (index analysis in the usual path,NullSourcefor empty parts, parallel replicas).Adds storage-side support and coordination:
IStorage::supportsStreaming(), MergeTree/ReplicatedMergeTree enable it, streaming subscriptions (SubscriptionManager,MergeTreeBoundsSubscription,WakeupFd) are enriched via a new background assignee, and schema-changingALTERis rejected while a streaming subscription exists. Includes client/interpreter tweaks to disable pretty-output squashing for streaming queries, new error codes, and new gtests/stateless tests covering parsing and streaming behavior.Reviewed by Cursor Bugbot for commit 71ff944. Bugbot is set up for automated code reviews on this repo. Configure here.