What do I have:
- I have several Google Accounts and their corresponding Google Analytics accounts. New ones will be added in the future.
- There is also a ClickHouse database, which is located in a cluster on Yandex Cloud. (Yandex Managed Service for ClickHouse)
- And there is a connector that uploads data from Google Analytics to a separate ClickHouse table.
Problem: The problem is that, due to the specifics of this table connector, several tables are created when only one is needed.
My idea: I can get the name of all tables and group them into an array. Since all tables have the same columns, I can join tables using UNION ALL. But I don't know how to iterate through the array and connect each table to each other. (As far as I understand, Yandex Cloud does not provide for the creation of custom functions). Can I loop through the array somehow? Are there any other ways to join tables?