Skip to content

Commit

Permalink
Split tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdi committed Feb 5, 2024
1 parent 2fb7f98 commit 87cc319
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 57 deletions.
Expand Up @@ -7,9 +7,3 @@ ds_3_1 all_1_1_0 0
ds_3_1 all_2_2_0 0
landing all_1_1_0 0
10
-----
0
ds_1_1_fix all_1_1_0 0
ds_1_1_fix all_2_2_0 0
landing_fix all_1_1_0 0
10
Expand Up @@ -101,54 +101,3 @@ DROP VIEW mv_2_2;

DROP TABLE ds_3_1;
DROP VIEW mv_3_1;

SELECT '-----';

DROP TABLE IF EXISTS landing_fix;
CREATE TABLE landing_fix
(
timestamp UInt64,
value UInt64
)
ENGINE = MergeTree ORDER BY tuple() SETTINGS non_replicated_deduplication_window = 1000;

DROP TABLE IF EXISTS ds_1_1_fix;
CREATE TABLE ds_1_1_fix
(
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_fix as
SELECT
timestamp t, sum(value) v
FROM landing_fix
GROUP BY t;

DROP VIEW IF EXISTS mv_1_2;
CREATE MATERIALIZED VIEW mv_1_2 TO ds_1_1_fix as
SELECT
timestamp t, sum(value) v
FROM landing_fix
GROUP BY t;

INSERT INTO landing_fix SELECT 1 as timestamp, 1 AS value FROM numbers(10);

SELECT sleep(3);

INSERT INTO landing_fix SELECT 1 as timestamp, 1 AS value FROM numbers(10);

SYSTEM FLUSH LOGS;
SELECT table, name, error FROM system.part_log
WHERE database = currentDatabase() AND table LIKE '%_fix'
ORDER BY table, name;

SELECT count() FROM landing_fix;

DROP TABLE landing_fix;

DROP TABLE ds_1_1_fix;
DROP VIEW mv_1_1;
DROP VIEW mv_1_2;
@@ -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
@@ -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;

0 comments on commit 87cc319

Please sign in to comment.