Skip to content

Feature request: dictionaries scope #4201

@filimonov

Description

@filimonov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-dictionaryDictionaries (in-memory key-value, periodically refreshed from sources).feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions