---
title: "Executable UDFs are now in public beta on ClickHouse Cloud"
description: "Executable UDFs are available in public beta on ClickHouse Cloud, allowing Python functions packaged as zip files to be called from SQL like built-in functions. ClickHouse runs them in a pool of long-lived sandboxed processes, keeping model code near the data and supporting use in ad-hoc queries, joins, and materialized views. The demonstration wraps a roughly 270K-parameter PyTorch autoencoder in an embed_trade UDF that consumes 14 features, produces a 32-dimensional embedding and reconstruction error, and scores trades as they enter through a materialized view. Training uses streamed Parquet chunks, incremental StandardScaler fitting, early stopping, and saved model artifacts; the deployed pool keeps the 2MB model hot, so inference occurs once per trade and downstream queries read the resulting table."
---

# Executable UDFs are now in public beta on ClickHouse Cloud

[Clickhouse](https://yomu.fyi/company/clickhouse) · May 30, 2026

**Type:** Announcement

## Summary

Executable UDFs are available in public beta on ClickHouse Cloud, allowing Python functions packaged as zip files to be called from SQL like built-in functions. ClickHouse runs them in a pool of long-lived sandboxed processes, keeping model code near the data and supporting use in ad-hoc queries, joins, and materialized views. The demonstration wraps a roughly 270K-parameter PyTorch autoencoder in an embed\_trade UDF that consumes 14 features, produces a 32-dimensional embedding and reconstruction error, and scores trades as they enter through a materialized view. Training uses streamed Parquet chunks, incremental StandardScaler fitting, early stopping, and saved model artifacts; the deployed pool keeps the 2MB model hot, so inference occurs once per trade and downstream queries read the resulting table.

## Context

Applying a trained model to streaming ClickHouse data previously required a separate scoring service, translating the model into SQL, or batch scoring offline. These options add infrastructure, make model updates cumbersome, or sacrifice freshness for data that needs to be evaluated as it arrives.

## Approach / What changed

A Python model is packaged with its dependencies and artifacts in a zip file and uploaded through the ClickHouse Cloud console as an executable\_pool UDF. Long-lived sandboxed processes load the model at startup, while a materialized view calls the UDF on every insert and writes embeddings and reconstruction scores to a table for downstream SQL queries.

## Takeaways

- Executable UDFs can be called from SQL in ad-hoc queries, joins, and materialized views, including views that run on every insert.
- The demo's embed\_trade UDF wraps a roughly 270K-parameter PyTorch autoencoder, producing a 32-dimensional embedding and reconstruction error from 14 input features.
- The deployed pool loads the 2MB model once per process and performs inference once per trade during ingest; the webapp reads the resulting table instead of rerunning the model.

**Tags:** [Deployment](https://yomu.fyi/topic/deployment), [Machine Learning](https://yomu.fyi/topic/machine-learning), [Python](https://yomu.fyi/topic/python), [Streaming](https://yomu.fyi/topic/streaming)

- Source: [Clickhouse](https://clickhouse.com/blog/executable-udfs-clickhouse-cloud-beta)
- Source URL: https://clickhouse.com/blog/executable-udfs-clickhouse-cloud-beta
- Ingested by Yomu: 2026-08-29T00:00:57.098Z

[Read original post](https://clickhouse.com/blog/executable-udfs-clickhouse-cloud-beta)
