mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Merge pull request #50409 from den-crane/test/issue_42610
test for #42610
This commit is contained in:
commit
2fbf826b5c
@ -0,0 +1,4 @@
|
||||
view 1 2022-10-20 first
|
||||
dict 1 2022-10-20 first
|
||||
view 1 2022-10-21 second
|
||||
dict 1 2022-10-21 second
|
@ -0,0 +1,54 @@
|
||||
-- Tags: long
|
||||
|
||||
DROP DICTIONARY IF EXISTS TestTblDict;
|
||||
DROP VIEW IF EXISTS TestTbl_view;
|
||||
DROP TABLE IF EXISTS TestTbl;
|
||||
|
||||
CREATE TABLE TestTbl
|
||||
(
|
||||
`id` UInt16,
|
||||
`dt` Date,
|
||||
`val` String
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
PARTITION BY dt
|
||||
ORDER BY (id);
|
||||
|
||||
CREATE VIEW TestTbl_view
|
||||
AS
|
||||
SELECT *
|
||||
FROM TestTbl
|
||||
WHERE dt = ( SELECT max(dt) FROM TestTbl );
|
||||
|
||||
CREATE DICTIONARY IF NOT EXISTS TestTblDict
|
||||
(
|
||||
`id` UInt16,
|
||||
`dt` Date,
|
||||
`val` String
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(TABLE TestTbl_view DB currentDatabase()))
|
||||
LIFETIME(1)
|
||||
LAYOUT(COMPLEX_KEY_HASHED());
|
||||
|
||||
select 'view' src,* FROM TestTbl_view;
|
||||
select 'dict' src,* FROM TestTblDict ;
|
||||
|
||||
insert into TestTbl values(1, '2022-10-20', 'first');
|
||||
|
||||
SELECT sleep(3) from numbers(4) settings max_block_size= 1 format Null;
|
||||
|
||||
select 'view' src,* FROM TestTbl_view;
|
||||
select 'dict' src,* FROM TestTblDict ;
|
||||
|
||||
insert into TestTbl values(1, '2022-10-21', 'second');
|
||||
|
||||
SELECT sleep(3) from numbers(4) settings max_block_size= 1 format Null;
|
||||
|
||||
select 'view' src,* FROM TestTbl_view;
|
||||
select 'dict' src,* FROM TestTblDict ;
|
||||
|
||||
DROP DICTIONARY IF EXISTS TestTblDict;
|
||||
DROP VIEW IF EXISTS TestTbl_view;
|
||||
DROP TABLE IF EXISTS TestTbl;
|
||||
|
Loading…
Reference in New Issue
Block a user