v.21.8Improvement
Support Regex in Database Argument for StorageMerge
Support regular expression inDatabaseargument forStorageMerge. Close #776. #25064 (flynn).
Why it matters
This feature allows users to specify a regular expression for theDatabase argument in the StorageMerge table engine, enabling dynamic merging of tables from multiple databases that match the regex pattern. It enhances flexibility and reduces the need to list databases explicitly.How to use it
When creating or altering aStorageMerge table, provide a regular expression pattern in the Database argument instead of a fixed database name. For example:CREATE TABLE merged_table AS Merge('^db_prefix.$', 'table_name', 'Merge')This will merge all tables named
table_name from databases whose names match the regex ^db_prefix.$.