【发布时间】:2021-10-24 05:26:39
【问题描述】:
我正在尝试将 Maxmind 数据插入 Clickhouse 字典,但将其源定义为本地文件,我可以从中运行我的客户端。
所以要定义我的字典,我使用查询:
CREATE DICTIONARY usage_analytics.city_locations(
geoname_id UInt64 DEFAULT 0,
...
...
...
...
)
PRIMARY KEY geoname_id
SOURCE(File(path '/home/ubuntu/maxmind_csv/GeoLite2-City-Locations-en.csv' format 'CSVWithNames'))
SETTINGS(format_csv_allow_single_quotes = 0)
LAYOUT(HASHED())
LIFETIME(300);
但我一直受到以下错误的打击:
Failed to load dictionary 'usage_analytics.city_locations': std::exception. Code: 1001, type: std::__1::__fs::filesystem::filesystem_error, e.what() = filesystem error: in canonical: No such file or directory [\home/ubuntu/maxmind_csv/GeoLite2-City-Locations-en.csv] [/],
根据文档,我必须使用它的绝对路径,这是我通过使用 readlink 完成的,但它仍然无法检测到我的文件。我正在从远程计算机运行 clickhouse 客户端,并将文件保存在远程计算机上。我是否应该将我的文件放在其他地方或什么地方?
【问题讨论】:
标签: clickhouse maxmind clickhouse-client