This post showcases the use of User-Defined Functions (UDFs) in ClickHouse to solve a complex query problem involving file renames. The author demonstrates how to create a recursive UDF, `file_path_history`, to collect the full path history of a file by recursively traversing the rename hierarchy. Despite the limitation that recursion is not currently supported in ClickHouse UDFs, the authors work around this limitation by specifying the function N times, where each function calls another. The resulting query can be used to get the full commit history of a file and solve the original question. The post concludes by highlighting the potential for UDFs to extend the behavior of ClickHouse and encouraging readers to share their own usage of UDFs in ClickHouse Cloud.