Repository navigation
Remove WINDOW VIEW - #114747
Remove WINDOW VIEW#114747
WINDOW VIEW#114747Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Workflow [PR], commit [ad14224] Summary: ✅
AI ReviewSummaryThis PR removes the experimental Findings
Final Verdict
LLVM Coverage ReportMeasured on commit ad14224.
Changed lines: Changed C/C++ lines covered: 382/386 (98.96%) · Uncovered code |
The experimental `WINDOW VIEW` feature is removed, following the same path as the `LIVE VIEW` removal (PR #88706): - `StorageWindowView`, `WindowViewSource`, `StorageBlocks` and `WatermarkTransform` are deleted together with the CREATE WINDOW VIEW parser, the WATCH statement (window views were its last implementor), the `windowID` function, and the WATCH, EVENTS, ALLOWED_LATENESS and STRICTLY_ASCENDING keywords. - The settings `allow_experimental_window_view`, `window_view_clean_interval`, `window_view_heartbeat_interval` and `wait_for_window_view_fire_signal_timeout` are kept as obsolete no-ops. - The `tumble`/`hop`/`tumbleStart`/`tumbleEnd`/`hopStart`/`hopEnd` functions are kept. The UInt32 single-argument forms of the bound-extraction functions, which only accepted `windowID` output, are removed. Their coverage from 01049_window_view_window_functions moved to 04891_time_window_functions. - `QueryViewsLogElement::ViewType::WINDOW` and `ViewTarget::Inner` are kept so that old log tables and DDL log entries remain readable. - Docs: the Window View section, the WATCH page, and its navigation entries are removed; the old-slug redirects are retargeted. The feature has been non-functional since Dec 2024 (commit ceae84c removed the view-dependency registration, issue #113493), was never ported to the analyzer, and its tests were removed in PR #73822. A server with a window view left in metadata will fail to load it: drop window views before upgrading. Related: #114738 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Only the window-view-related parts of the generated settings and functions reference: the window-view.mdx settings page, the four obsolete settings' entries (pages, manifest, navigation, the settings explorer), and the `windowID` section and `WINDOW VIEW` mentions in time-window-functions.mdx. The drift accumulated on master since the last nightly regeneration is deliberately not included; the nightly docs-autogen job will pick it up. The PR carries the pr-autogenerated-docs label because these regions are autogenerated. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
f3e6822 to
c37be27
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes354 object files changed (-473.03 KiB total), 0 added.
721 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units1122 translation units recompiled, 7300 s compile time in total, 1122 of them have a recent master baseline. |
# Conflicts: # docs/_site/customizations/settings-legacy-routes/session-settings.js # docs/snippets/components/SessionSettingsExplorer/SessionSettingsExplorer.jsx
…undary
`ASTCreateQuery::readJSON` no longer reads `is_window_view`, the watermark
strategies, `allowed_lateness`, or the `watermark_function` / `lateness_function`
children, and `JSONObjectReader` ignores keys it does not read. A legacy
`clickhouse_json` payload of a window view therefore deserialized as an ordinary
`CREATE TABLE ... AS SELECT` - all create-kind flags false with `select` set,
which `isCreateQueryWithImmediateInsertSelect` accepts and executes as an
immediate-population table create. Reject such payloads instead.
The flags are rejected only when set: `writeJSON` emitted them for every `CREATE`
form (`writeBool` always writes the key, `false` included), so a legacy payload of
an ordinary query carries them as `false` and must still be accepted. `writeChild`
skipped null children, so the two expression fields are rejected by presence.
`ASTViewTargets::readJSON` now also rejects the `Inner` target kind. Nothing
produces it any more - `ParserViewTargets` throws for it, `ParserCreateQuery` and
`CreateQueryUUIDs` only build `To` / `Samples` / `Tags` / `Metrics`, and the only
syntax that ever carried an inner target was `CREATE WINDOW VIEW ... INNER ENGINE`.
Formatting such a target is lossy in both directions: a crafted
`{"kind":"Inner","inner_engine":...}` formatted as
`CREATE MATERIALIZED VIEW mv TO dst INNER ENGINE = Memory AS SELECT 1`, which the
SQL parser no longer accepts, while a bare `Inner` target was dropped from the
formatted SQL entirely. The kind itself stays in `ViewTarget::Kind` so that the
UUID mappings of old DDL log entries still parse.
Co-Authored-By: Claude Fable 5 <[email protected]>
…for the upgrade check
The upgrade check runs the *previous release's* stateless suite under the
*previous release's* binary, and v26.7 still contains
`04202_window_view_disabled_with_analyzer` and `04218_window_view_insert_70296`,
which create window views. `clickhouse-test --upgrade-check` runs the client with
`--fake-drop` (`ignore_drop_queries_probability = 1`), so their `DROP TABLE` is
ignored and the window view stays in the metadata. The new binary does not merely
skip such a table - it fails to start:
<Error> Application: Caught exception while loading metadata: Code: 62.
DB::Exception: Syntax error (in file store/.../wv.sql): failed at position 8
(WINDOW) ... Cannot parse definition from metadata file ... (SYNTAX_ERROR)
Dropping the constraint would therefore let the upgrade check brick its own
post-upgrade restart, depending on which of the old tests ran within the global
time limit.
Only the constraint is restored, not the profile value that `master` also had:
`<readonly/>` alone rejects any change with `SETTING_CONSTRAINT_VIOLATION`, and
both binaries default the setting to `false`. Assigning the value would mark an
obsolete setting as changed on the new binary, adding an `Obsolete setting` entry
to `system.warnings` that `01945_system_warnings` asserts is absent.
Co-Authored-By: Claude Fable 5 <[email protected]>
`SQLDefinedHandlerFromAST` landed on `master` after this branch was created and includes `Parsers/ASTWatchQuery.h` to exempt `WATCH` from the "a mutating query needs a mutating HTTP method" gate of `CREATE HANDLER`. The `WATCH` statement is gone, so drop that branch and the stale comment in `statementHasSideEffectsUnderReadonly`. (`04652_create_handler_watch`, which pinned the behaviour, is deleted in the preceding commit.) Co-Authored-By: Claude Fable 5 <[email protected]>
`WATCH`, `EVENTS` and `STRICTLY_ASCENDING` are no longer keywords, so drop them from the client's highlighting list and from the Web UI's copy of it (the two are kept in sync). Also fix the `ParserInsertQuery` doc comment, which still described `INSERT INTO ... SELECT | WATCH`. Co-Authored-By: Claude Fable 5 <[email protected]>
…continue # Conflicts: # docs/ar/reference/navigation.json # docs/es/reference/navigation.json # docs/fr/reference/navigation.json # docs/ja/reference/navigation.json # docs/ko/reference/navigation.json # docs/pt-BR/reference/navigation.json # docs/ru/reference/navigation.json # docs/snippets/components/SessionSettingsExplorer/SessionSettingsExplorer.jsx # docs/zh/reference/navigation.json
This should be deleted right away. |
Three separate follow-ups, all of them user-facing documentation:
- `src/Functions/FunctionsTimeWindow.cpp`: restore the deterministic
`toDateTime('2026-01-02 03:04:05', 'UTC')` arguments in the `tumble` / `tumbleStart` /
`tumbleEnd` / `hop` / `hopStart` / `hopEnd` examples. `master` replaced the original
`now()` calls, whose documented responses were pinned to a fixed date and therefore
could never match, and an earlier merge of this branch resolved that hunk to our
(older) side. It made `Docs examples` red with six unexpected failures, one per
surviving time-window function.
- `docs/reference/functions/regular-functions/time-window-functions.mdx`: drop the link
to the removed `#window-view` anchor of the `CREATE VIEW` page, which was the last
error of `Check internal links and anchors`, and regenerate the three `hop` / `hopStart`
/ `hopEnd` descriptions, which still said the first-window bound is returned "when hop
function is used without `WINDOW VIEW`" while the `FunctionDocumentation` source they
come from no longer does.
- `docs/integrations/language-clients/rust/index.mdx`: scope the three `WATCH` mentions
(the `lz4` compression default, the `watch` cargo feature, and the mocking utilities)
to servers older than v26.9. The `clickhouse-rs` crate keeps its `watch` feature, so
the right fix is to say which servers accept the statement rather than to delete the
bullets. The dangling "See the corresponding section for details" is dropped along
with it: the section it pointed at was the `WATCH` reference page.
|
🕵 Status after merging
|
The pull request deletes `docs/reference/settings/session-settings/window-view.mdx`, but nothing preserved the published `/reference/settings/session-settings/window-view` route, so existing links and bookmarks for `window_view_clean_interval` / `window_view_heartbeat_interval` would start returning 404. Add a redirect to the session settings index for that route in every language, the same way the removed `WATCH` page is redirected, and delete the localized copies of the page together with their navigation entries, matching how the localized `WATCH` pages are removed.
| { | ||
| FunctionArgumentDescriptors mandatory_args{ | ||
| {"window_id_or_tuple", &isTupleOfTwoDateTimesOrUInt32, nullptr, "Tuple(Date/DateTime, Date/DateTime) or UInt32"} | ||
| {"window_tuple", &isTupleOfTwoDateTimes, nullptr, "Tuple(Date/DateTime, Date/DateTime)"} |
There was a problem hiding this comment.
isTupleOfTwoDateTimes still strips inner nullability, so this one-argument overload accepts Tuple(Nullable(Date/DateTime), ...) and getReturnTypeImpl even propagates the nullable element type. But executeWindowBound only accepts bare ColumnVector<UInt16/UInt32> elements, so the same shape is rejected later with ILLEGAL_TYPE_OF_ARGUMENT. That leaves the public contract self-contradictory, and the new negative expectations in 04891_time_window_functions.sql are now pinning that mismatch in place.
Please make the contract consistent in one direction or the other: either reject nullable tuple elements at validation time here, or allow them in executeWindowBound and update the tests accordingly.
Master removed the window view storage in ClickHouse#114747, so the branch's only conflict is the modify/delete on StorageWindowView.cpp. Accepted the deletion. The arm it carried relaxed allow_non_metadata_alters around the internal cleanup ALTER that StorageWindowView issued for windows past the watermark. That synthesizer no longer exists, so the relaxation has no caller and is dropped rather than relocated. The other internal synthesizers the branch covers are unaffected. Co-Authored-By: Claude Opus 5 <[email protected]>
The test broke the connection between a `Distributed` table and its remote shard, healed it, and then waited a fixed 5 seconds for the background sender to deliver the two pending inserts. That wait races the sender's retry interval: every failed attempt doubles it, starting at `background_insert_sleep_time_ms` (100 ms) and growing up to `background_insert_max_sleep_time_ms`, which defaults to 30 seconds. A newly inserted file does not shorten an interval the sender is already waiting out, because `addFileAndSchedule` calls `scheduleAfter` with `overwrite = false`, which is a no-op for an already delayed task. So the test could see only the first row and fail with `assert '1' == '3'`. Measured with two local servers, stopping and restarting the shard in place of the network partition: after a 60 second outage the sender's `error_count` reaches 9, which saturates the interval at the 30 second cap, and all rows arrive 20.2 seconds after the shard comes back - four times the 5 seconds the test allowed. With `background_insert_max_sleep_time_ms = 1000` the same scenario delivers everything in 1.5 seconds. The test now caps that setting on its table and waits for the observable state instead of sleeping: for the rows to appear on the shard, and - in place of the sleep that was there to let the send fail while the connection was down - for `error_count` in `system.distribution_queue` to grow. The latter also states the intent explicitly, that healing the partition has to exercise a reconnection. The test has never failed on `master`; in the last 90 days it failed four times, all of them on pull requests and all in instrumented builds (two under `amd_llvm_coverage`, two under `amd_msan`), which is what a slow machine accumulating more failed attempts inside the same partition window looks like. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114747&sha=ad14224d5f960e11c6fddf144128ac30beed5cc8&name_0=PR&name_1=Integration%20tests%20%28amd_llvm_coverage%2C%206%2F8%29 Related: ClickHouse#114747 Co-Authored-By: Claude Fable 5 <[email protected]>
WINDOW VIEW was removed on master (ClickHouse#114747), so `ASTCreateQuery` no longer has `is_window_view` and the stored metadata can no longer hold that kind: `isView()` is now exactly an ordinary or a materialized view. Remove the check that rejected a stored Window View and its test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Delete the test and reference for the removed `WINDOW VIEW` feature. Keep direct, materialized-view, and forwarded-insert metric coverage. Related: ClickHouse#110391 Related: ClickHouse#114747 CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=110391&sha=6207933a61c1025ecf1957685683bb96e2fd7fa8&name_0=PR&name_1=Fast%20test
Closes: #61069
Closes: #113493
Closes: #114097
Closes: #75191
Related: #114738
Related: #88706
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The experimental
WINDOW VIEWfeature is removed, together with theWATCHstatement and thewindowIDfunction. It has been non-functional since version 24.12 (inserts into the source table were silently not delivered to window views) and was never supported by the analyzer, which is enabled by default since 24.3. The settingsallow_experimental_window_view,window_view_clean_interval,window_view_heartbeat_interval, andwait_for_window_view_fire_signal_timeoutare kept as obsolete no-ops. The time-window functionstumble,tumbleStart,tumbleEnd,hop,hopStart, andhopEndare kept. If you still have window views defined, drop them before upgrading: a server that finds a window view in its metadata fails to start (Cannot parse definition from metadata file ... (SYNTAX_ERROR)), the same way the removal of theLazydatabase engine behaves. Similar functionality will be reimplemented on top of streaming queries (issue #114738).The removal, in detail:
src/Storages/WindowView/(StorageWindowView,WindowViewSource,StorageBlocks),WatermarkTransform, theParserCreateWindowViewQueryparser, and the wholeWATCHstatement stack (ParserWatchQuery,ASTWatchQuery,InterpreterWatchQuery, theIStorage::watchvirtual) — window views were the last implementor ofwatch, and theWATCHstatement was already documented as deprecated.ASTCreateQuerywatermark/lateness fields and their AST JSON serialization and validation. Theclickhouse_jsonboundary fails closed rather than silently reinterpreting legacy payloads:ASTCreateQuery::readJSONrejects a setis_window_view, watermark strategy orallowed_latenessflag and thewatermark_function/lateness_functionchildren (otherwise such a payload deserialized as an ordinaryCREATE TABLE ... AS SELECTand was executed as an immediate-population table create), whileASTViewTargets::readJSONrejects theInnertarget kind, which nothing produces any more and which formatted back to parser-impossibleINNER ENGINE ...SQL. Both are covered by04892_ast_json_removed_window_view_state; thePushingToWindowViewSinkandViewType::WINDOWbranches inInsertDependenciesBuilder; window-view special cases inInterpreterCreateQuery,InterpreterInsertQuery,StorageFactory,DatabaseOrdinary,DatabaseReplicated,DDLDependencyVisitor,QueryFuzzer, BuzzHouse, and the ArrowFlight table-type mapping.windowIDfunction and theUInt32single-argument forms oftumbleStart/tumbleEnd/hopStart/hopEnd(they only acceptedwindowIDoutput). The rest of the time-window function family stays, since these are ordinary functions usable in a regularGROUP BYand are exactly the vocabulary for the streaming-queries replacement.WATCH,EVENTS,ALLOWED_LATENESS, andSTRICTLY_ASCENDING(theWATERMARKkeyword stays: the streaming-queriesWATERMARK FORclause uses it), the error codeQUERY_IS_NOT_SUPPORTED_IN_WINDOW_VIEW, and the corresponding fuzzer dictionary and ANTLR grammar entries.QueryViewsLogElement::ViewType::WINDOW(so existingsystem.query_views_logtables keep their schema) andViewTarget::Inner(so old DDL log entries still parse), following the same pattern as theLIVE VIEWremoval.Replicateddatabases, again following theLIVE VIEWprecedent: a lagging replica that upgrades and then replays a retainedCREATE WINDOW VIEWDDL queue entry stalls on a plainSYNTAX_ERROR— the same long-standing behavior as for any queue entry with unknown syntax (for example, one written by a newer server) — and the replica should be recreated. An earlier revision of this PR carried a token-level rewriting layer inDatabaseReplicatedWorkerthat tried to skip such entries and their follow-ups; it was removed as an unmaintainable fallback path (review kept finding shapes of retainedRENAME/EXCHANGE/ATTACHhistory that it silently mishandled), in favor of failing closed.CREATE HANDLER ... AS WATCH ...definition no longer parses.CREATE HANDLERhas never appeared in a released version (it exists only onmasterand in the unreleased26.8branch), andWATCHthere can only target a window view, which the upgrade path already requires dropping.allow_experimental_window_viewconstraint intests/docker_scripts/stress_tests.libis kept (only the constraint, not the profile value, which would mark an obsolete setting as changed and add asystem.warningsentry): the upgrade check runs the previous release's suite under the previous release's binary, whose window-view tests are not dropped afterwards because--upgrade-checkimplies--fake-drop, and the leftover metadata would then stop the new server from starting.hopoverflow regressions stay:04891_time_window_functions_wrapped_interval_overflowkeeps itshopassertions without thewindowIDones, and thehophalf of04201_windowID_hop_time_overflowmoved to05043_hop_window_end_past_datetime_range. The pure time-window-function coverage of01049_window_view_window_functionsmoved to a new04891_time_window_functionstest, which also pins the newILLEGAL_TYPE_OF_ARGUMENTbehavior oftumbleStart(UInt32).Window Viewsection ofCREATE VIEW(which master has since moved into theCREATE VIEWdoc string ofsrc/Parsers/ParserCreateQuery.cpp, from where the autogenerated region ofdocs/reference/statements/create/view.mdxis produced), theWATCHpage (with its navigation entries and locale twins) are removed and the old-slug redirects retargeted; the window-view entries are removed from the generated settings/functions reference pages (second commit, hence thepr-autogenerated-docslabel): thewindow-view.mdxsettings page, the four settings' entries in the pages/manifest/navigation/settings explorer, and thewindowIDsection oftime-window-functions.mdx. The unrelated drift accumulated on master since the last nightly regeneration is deliberately not included; the nightly docs-autogen job will pick it up. The hand-written intro oftime-window-functions.mdxno longer links to the removed#window-viewanchor of theCREATE VIEWpage, and thehop/hopStart/hopEnddescriptions no longer say that the bound of the first window is returned "withoutWINDOW VIEW". Indocs/integrations/language-clients/rust/index.mdx, the threeWATCHmentions (theCompression::Lz4default, thewatchcargo feature, and the mocking utilities) are scoped to servers older than v26.9: theclickhouse-rscrate keeps itswatchfeature, so the accurate statement is which servers accept the query.Why now: the feature has been non-functional since Dec 2024 — commit
ceae84c87a2removed the explicit view-dependency registration andDDLDependencyVisitornever extracted the source table of aCREATE WINDOW VIEW, so inserts into the source table were silently not pushed to window views, and direct inserts failed withstd::out_of_range(#113493). Nobody noticed for ~1.5 years. It was never ported to the analyzer (withenable_analyzer = 1, the default, existing window views load permanently inert), its tests were removed in #73822 because they were inherently flaky, and it kept costing triage time (#114097 is a recent server SIGSEGV throughgetSourceTableSelectQuery).The full assessment, including the plan for reimplementing this functionality on top of streaming queries (
SELECT ... FROM t STREAM,WATERMARK FOR, emit-on-watermark windowed aggregation), is in #114738.Documentation entry for user-facing changes
Workflow [PR]
Sync PR [sync-upstream/pr/114747]
Version info
26.9.1.384(included in26.9and later)