Executable UDFs are now in public beta on ClickHouse Cloud
Blog post from ClickHouse
ClickHouse Cloud has introduced executable User-Defined Functions (UDFs) in public beta, allowing users to write Python functions that can be uploaded and executed within SQL queries. This functionality enables seamless integration of machine learning models with data in ClickHouse, eliminating the need for separate scoring services or complex SQL translations. An example application demonstrates the use of a PyTorch autoencoder for anomaly detection in equity trades, where each trade is scored inline with its data ingestion. The model is trained on historical data and the results are processed through a materialized view, with anomaly scores being stored for further analysis. Additionally, the system supports network-accessible UDFs in private beta, which can fetch external data to provide insights into detected anomalies, thus simplifying the integration of external APIs and machine learning models directly within SQL workflows. This approach reduces the complexity typically associated with ML streaming data architectures by embedding Python functionality directly in SQL queries.