-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64264 from ClickHouse/cherrypick/23.8/d2231732bbf…
…7ea0063e19846e7a937e6e1b21cdd Cherry pick #64174 to 23.8: Prevent LOGICAL_ERROR on CREATE TABLE as MaterializedView
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
DROP TABLE IF EXISTS base_table; | ||
DROP TABLE IF EXISTS target_table; | ||
DROP TABLE IF EXISTS mv_from_base_to_target; | ||
DROP TABLE IF EXISTS mv_with_storage; | ||
DROP TABLE IF EXISTS other_table_1; | ||
DROP TABLE IF EXISTS other_table_2; | ||
|
||
CREATE TABLE base_table (date DateTime, id String, cost Float64) ENGINE = MergeTree() ORDER BY date; | ||
CREATE TABLE target_table (id String, total AggregateFunction(sum, Float64)) ENGINE = MergeTree() ORDER BY id; | ||
CREATE MATERIALIZED VIEW mv_from_base_to_target TO target_table AS Select id, sumState(cost) FROM base_table GROUP BY id; | ||
CREATE MATERIALIZED VIEW mv_with_storage ENGINE=MergeTree() ORDER BY id AS Select id, sumState(cost) FROM base_table GROUP BY id; | ||
|
||
CREATE TABLE other_table_1 AS mv_with_storage; | ||
CREATE TABLE other_table_2 AS mv_from_base_to_target; -- { serverError INCORRECT_QUERY } |