Syntax
A dictionary can be connected to ClickHouse from many different sources.
The source is configured in the source section for configuration file and using the SOURCE clause for DDL statement.
CREATE DICTIONARY dict_name (...)
...
SOURCE(SOURCE_TYPE(param1 val1 ... paramN valN)) -- Source configuration
...<clickhouse>
<dictionary>
...
<source>
<source_type>
<!-- Source configuration -->
</source_type>
</source>
...
</dictionary>
...
</clickhouse>Supported dictionary sources
The following source types (SOURCE_TYPE/source_type) are available:
For source types Local file, Executable file, HTTP(s), ClickHouse optional settings are available:
SOURCE(FILE(path './user_files/os.tsv' format 'TabSeparated'))
SETTINGS(format_csv_allow_single_quotes = 0)<source>
<file>
<path>/opt/dictionaries/os.tsv</path>
<format>TabSeparated</format>
</file>
<settings>
<format_csv_allow_single_quotes>0</format_csv_allow_single_quotes>
</settings>
</source>