I have created a file (-rwxrwxrwx 1 clickhouse clickhouse 522 Aug 27 14:22 SeqTypesKeyValues.csv) with the following contents:
$ cat /etc/clickhouse-server/SeqTypesKeyValues.csv
0;Zero
1;One
In /etc/clickhouse-server/config.xml above </yandex> tag, I have put the following:
<dictionary>
<name>SeqTypes</name>
<source>
<file>
<path>/etc/clickhouse-server/SeqTypesKeyValues.csv</path>
<format>CSV</format>
</file>
</source>
<lifetime>30</lifetime>
<layout>
<flat />
</layout>
<structure>
<id>
<name>SeqID</name>
</id>
<attribute>
<name>SeqType</name>
<type>String</type>
</attribute>
</structure>
</dictionary>
In clickhouse-server.log there are no errors.
When I execute:
select dictGetString('SeqTypes', 'SeqType', toUInt64(1))
I get
SQL Error [36]: ClickHouse exception, code: 36, host: localhost, port: 2001; Code: 36, e.displayText() = DB::Exception: No such external dictionary: SeqTypes, e.what() = DB::Exception
How come that SeqTypes directory does not exist?
Can someone help?
Regards.
0,Zero
1,One
<name>SeqTypes</name>
</dictionary>
<yandex> <comment>An optional element with any content. Ignored by the ClickHouse server.</comment> <!--Optional element. File name with substitutions--> <include_from>/etc/metrika.xml</include_from> <dictionary> <!-- Dictionary configuration --> </dictionary> ... <dictionary> <!-- Dictionary configuration --> </dictionary> </yandex>
Anyway, now dictionary works. Thank you all very very much.
Best regards.