docs/en/sql-reference/statements/create/dictionary/sources/overview.md
import CloudDetails from '@site/docs/sql-reference/statements/create/dictionary/_snippet_dictionary_in_cloud.md'; import CloudNotSupportedBadge from '@theme/badges/CloudNotSupportedBadge'; import ExperimentalBadge from '@theme/badges/ExperimentalBadge'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
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>
The following source types (SOURCE_TYPE/source_type) are available:
For source types Local file, Executable file, HTTP(s), ClickHouse optional settings are available:
<Tabs> <TabItem value="ddl" label="DDL" default>SOURCE(FILE(path './user_files/os.tsv' format 'TabSeparated'))
--highlight-next-line
SETTINGS(format_csv_allow_single_quotes = 0)
<source>
<file>
<path>/opt/dictionaries/os.tsv</path>
<format>TabSeparated</format>
</file>
<settings>
#highlight-next-line
<format_csv_allow_single_quotes>0</format_csv_allow_single_quotes>
</settings>
</source>