Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
57 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
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
5 changes: 5 additions & 0 deletions
5
...queries/0_stateless/02972_insert_deduplication_token_hierarchical_inserts_views.reference
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,5 @@ | ||
0 | ||
ds_1_1 all_1_1_0 0 | ||
ds_1_1 all_2_2_0 0 | ||
landing all_1_1_0 0 | ||
10 |
53 changes: 53 additions & 0 deletions
53
tests/queries/0_stateless/02972_insert_deduplication_token_hierarchical_inserts_views.sql
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,53 @@ | ||
SET insert_deduplicate = 1; | ||
SET deduplicate_blocks_in_dependent_materialized_views = 1; | ||
SET update_insert_deduplication_token_in_dependent_materialized_views = 1; | ||
SET insert_deduplication_token = 'test'; | ||
|
||
DROP TABLE IF EXISTS landing; | ||
CREATE TABLE landing | ||
( | ||
timestamp UInt64, | ||
value UInt64 | ||
) | ||
ENGINE = MergeTree ORDER BY tuple() SETTINGS non_replicated_deduplication_window = 1000; | ||
|
||
DROP TABLE IF EXISTS ds_1_1; | ||
CREATE TABLE ds_1_1 | ||
( | ||
t UInt64, | ||
v UInt64 | ||
) | ||
ENGINE = MergeTree ORDER BY tuple() SETTINGS non_replicated_deduplication_window = 1000; | ||
|
||
DROP VIEW IF EXISTS mv_1_1; | ||
CREATE MATERIALIZED VIEW mv_1_1 TO ds_1_1 as | ||
SELECT | ||
timestamp t, sum(value) v | ||
FROM landing | ||
GROUP BY t; | ||
|
||
DROP VIEW IF EXISTS mv_1_2; | ||
CREATE MATERIALIZED VIEW mv_1_2 TO ds_1_1 as | ||
SELECT | ||
timestamp t, sum(value) v | ||
FROM landing | ||
GROUP BY t; | ||
|
||
INSERT INTO landing SELECT 1 as timestamp, 1 AS value FROM numbers(10); | ||
|
||
SELECT sleep(3); | ||
|
||
INSERT INTO landing SELECT 1 as timestamp, 1 AS value FROM numbers(10); | ||
|
||
SYSTEM FLUSH LOGS; | ||
SELECT table, name, error FROM system.part_log | ||
WHERE database = currentDatabase() | ||
ORDER BY table, name; | ||
|
||
SELECT count() FROM landing; | ||
|
||
DROP TABLE landing; | ||
|
||
DROP TABLE ds_1_1; | ||
DROP VIEW mv_1_1; | ||
DROP VIEW mv_1_2; |