mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +00:00
21 lines
461 B
MySQL
21 lines
461 B
MySQL
|
DROP TABLE IF EXISTS src;
|
||
|
|
||
|
CREATE TABLE src (k UInt64, s FixedString(11)) ENGINE = Memory;
|
||
|
INSERT INTO src VALUES (1, 'Hello\0World');
|
||
|
|
||
|
DROP DICTIONARY IF EXISTS dict;
|
||
|
CREATE DICTIONARY dict
|
||
|
(
|
||
|
k UInt64,
|
||
|
s String
|
||
|
)
|
||
|
PRIMARY KEY k
|
||
|
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER default TABLE 'src'))
|
||
|
LAYOUT(FLAT)
|
||
|
LIFETIME(MIN 10 MAX 10);
|
||
|
|
||
|
SELECT dictGet(currentDatabase() || '.dict', 's', number) FROM numbers(2);
|
||
|
|
||
|
DROP TABLE src;
|
||
|
DROP DICTIONARY dict;
|