【发布时间】:2020-09-14 20:42:19
【问题描述】:
尝试按照instructions 使用 DDL 创建字典:
-- source table
create table brands (
id UInt64,
brand String
)
ENGINE = ReplacingMergeTree(id)
partition by tuple()
order by id;
-- some data
insert into brands values (1, 'cool'), (2, 'neat'), (3, 'fun');
-- dictionary references source table
CREATE DICTIONARY IF NOT EXISTS brand_dict (
id UInt64,
brand String
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(
host 'localhost'
port 9000
user 'default'
password ''
db 'default'
table 'brands'
))
LIFETIME(MIN 1 MAX 10)
LAYOUT(FLAT())
-- looks good:
show dictionaries;
-- no work
-- Code: 36. DB::Exception: Received from localhost:9000. DB::Exception: external dictionary 'brand_dict' not found.
select dictGetString('brand_dict', 'id', toUInt64(1));
给DB::Exception: external dictionary 'brand_dict' not found.
我还没有尝试过使用 XML 配置,所以不确定它是否特定于 DDL,或者我在那里做错了什么。
【问题讨论】:
标签: clickhouse