-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Feature request: dictionaries scope #4201
Description
It's quite common in staging environment to have multiple databases, one for each branch / stage.
Like
database_rc
- table1
- table2
database_master
- table1
- table2
database_testing
- table1
- table2
database_feature_branch_xxx
- table1
- table2
- table3a
It's easy to do in ClickHouse and (for example) in MySQL separately.
But if you want each database in ClickHouse to use the dictionary connected to MySQL of the corresponding stage - it's not possible, as dictionaries are in global namespace in ClickHouse.
So the proposition is - to create a scope for dictionaries, with the similar configuration syntax as <allow_databases>. By default, the global scope would be used. If the scope is defined, then that dictionary is registered in corresponding database namespace, otherwise - in the global namespace. If two dictionaries with the same name are registered in the same namespace - then exception happen. If the same dictionary is defined in DB scope and global scope - more specialized (i.e. from database scope) should be used.
That would allow creating the dictionary with the same name and different definition in different databases.