From 199eda4ee37a9a5f60219145ec3f427f985679b7 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Fri, 8 Oct 2021 11:48:10 +0300 Subject: [PATCH] Test for dictionaries with comments --- ...4_create_dictionary_with_comment.reference | 0 .../02024_create_dictionary_with_comment.sql | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/queries/0_stateless/02024_create_dictionary_with_comment.reference create mode 100644 tests/queries/0_stateless/02024_create_dictionary_with_comment.sql diff --git a/tests/queries/0_stateless/02024_create_dictionary_with_comment.reference b/tests/queries/0_stateless/02024_create_dictionary_with_comment.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/02024_create_dictionary_with_comment.sql b/tests/queries/0_stateless/02024_create_dictionary_with_comment.sql new file mode 100644 index 00000000000..de71d0d976b --- /dev/null +++ b/tests/queries/0_stateless/02024_create_dictionary_with_comment.sql @@ -0,0 +1,32 @@ +----------------------------------------------------------------------------------- +-- 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; + +SELECT comment FROM system.dictionaries WHERE name == '2024_dictionary_with_comment'; \ No newline at end of file