v.23.5New Feature

Add urlCluster Table Function and Refactor Cluster Functions to Reduce Duplication

Add urlCluster table function. Refactor all *Cluster table functions to reduce code duplication. Make schema inference work for all possible *Cluster function signatures and for named collections. Closes #38499. #45427 (attack204), Pavel Kruglov.
Introduces the urlCluster table function to ClickHouse and refactors existing *Cluster table functions to reduce code duplication and improve schema inference for all *Cluster function signatures and named collections.

Why it matters

The feature addresses code duplication in the implementation of *Cluster table functions and enhances schema inference capabilities, enabling better support for all function signatures and named collections. This improves maintainability and usability when working with distributed data across clusters.

How to use it

Use the new urlCluster table function in queries like other *Cluster functions. The schema inference now works automatically for all *Cluster table functions and named collections without additional configuration. Simply specify the urlCluster function along with the cluster and table parameters in your SQL queries to leverage distributed query capabilities.