ClickHouse/tests/queries/0_stateless/02024_create_dictionary_with_comment.sql

34 lines
1.1 KiB
MySQL
Raw Normal View History

2021-10-08 08:48:10 +00:00
-----------------------------------------------------------------------------------
-- Check that `DICTIONARY` can be created with a `COMMENT` clause
-- and comment is visible both in `comment` column of `system.dictionaries`
-- and `SHOW CREATE DICTIONARY`.
-----------------------------------------------------------------------------------
-- prerequisites
CREATE TABLE source_table
(
id UInt64,
value String
) ENGINE = Memory();
INSERT INTO source_table VALUES (1, 'First');
INSERT INTO source_table VALUES (2, 'Second');
DROP DICTIONARY IF EXISTS 2024_dictionary_with_comment;
CREATE DICTIONARY 2024_dictionary_with_comment
(
id UInt64,
value String
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() TABLE 'source_table'))
LAYOUT(FLAT())
LIFETIME(MIN 0 MAX 1000)
COMMENT 'Test dictionary with comment';
SHOW CREATE DICTIONARY 2024_dictionary_with_comment;
2021-10-08 16:56:25 +00:00
SELECT comment FROM system.dictionaries WHERE name == '2024_dictionary_with_comment' AND database == currentDatabase();
2021-10-08 08:48:10 +00:00
DROP DICTIONARY IF EXISTS 2024_dictionary_with_comment;