Forked from filimonov/_etc_clickhouse-server_dict_sources.xml
Created
October 6, 2021 13:55
-
-
Save yakimka/ba628507f061fe31cbbc0d8dce9168df to your computer and use it in GitHub Desktop.
ClickHouse dictionaries with connection credentials substituted from another file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<yandex> | |
<mysql_config> | |
<port>3306</port> | |
<user>user</user> | |
<password>123</password> | |
<replica> | |
<host>mysql_host</host> | |
<priority>1</priority> | |
</replica> | |
<db>owa_config</db> | |
</mysql_config> | |
</yandex> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<yandex> | |
<include_from>/etc/clickhouse-server/dict_sources.xml</include_from> | |
<comment>....</comment> | |
<dictionary> | |
<name>customer</name> | |
<source> | |
<mysql incl="mysql_config"> | |
<table>customer</table> | |
<invalidate_query>select concat(max(audit),count(*)) from customer</invalidate_query> | |
</mysql> | |
</source> | |
<lifetime> | |
<!-- every 8-12 h dict will be fully reloaded even if invalidate_query result doesn't change --> | |
<min>10800</min> | |
<max>43200</max> | |
</lifetime> | |
<layout> | |
<flat /> | |
</layout> | |
<structure> | |
<id> | |
<name>customerid</name> | |
</id> | |
<!-- usage: SELECT dictGetString('customer', 'company', toUInt64(505)) --> | |
<attribute> | |
<name>company</name> | |
<type>String</type> | |
<null_value></null_value> | |
</attribute> | |
<!-- usage: SELECT dictGetString('customer', 'email', toUInt64(505)) --> | |
<attribute> | |
<name>email</name> | |
<type>String</type> | |
<null_value></null_value> | |
</attribute> | |
<attribute> | |
<name>status</name> | |
<type>String</type> | |
<null_value></null_value> | |
</attribute> | |
</structure> | |
</dictionary> | |
</yandex> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment