Merge pull request #50409 from den-crane/test/issue_42610

test for #42610
This commit is contained in:
Alexey Milovidov 2023-06-02 01:16:59 +03:00 committed by GitHub
commit 2fbf826b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View File

@ -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

View File

@ -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;