Executable UDFs are now in public beta on ClickHouse Cloud
Executable UDFs are in public beta on ClickHouse Cloud: you upload a zipped Python function with its model files, and ClickHouse runs it in a pool of long-lived sandboxed processes that can be called from SQL, including inside materialized views. The demo trains a ~270K-parameter PyTorch autoencoder on trade ticks and scores each insert inline through a materialized view, producing a 32-dim embedding and a reconstruction error. A backfill of ~6B rows ran at ~35K rows/sec on a 3-replica cluster. A raw global anomaly threshold proved misleading for high-priced symbols, so anomalies are defined against per-symbol p95 baselines kept in an hourly refreshable materialized view, which cut leaderboard query time from ~1.7s to ~0.27s. Network-access UDFs that can make outbound HTTPS calls are in private beta.
Related posts
- Executable UDFs are now generally available on ClickHouse Cloud
ClickHouse mediumAdept
Executable UDFs are now generally available on ClickHouse Cloud across AWS, GCP and Azure, adding a Native runtime for statically linked Rust/Go/C++/JavaScript binaries, outbound network access, per-process memory limits, a deterministic flag that enables the query cache, Cloud API and Terraform support, and per-query UDF metrics in 26.6+. The worked example is a Rust tokenizer UDF built on tiktoken-rs that speaks RowBinary with chunk headers and is called from a materialized view at insert time to count LLM tokens per span. Its token counts are joined against a daily-refreshed LiteLLM price dictionary for cost attribution, and a Python UDF calls Claude to grade a sample of completions. Practical lessons include RowBinary being ~20% faster than TabSeparatedRaw and binary-safe, sizing memory limits for virtual address space (Go reserves ~1.2 GiB), and throughput of ~13M tokens/sec on 4 vCPUs.
- How Fountain rebuilt its data plane on ClickHouse Cloud to power Cue, the Frontline Superintelligence
ClickHouse mediumAdept
Fountain replaced a multi-vendor batch pipeline (third-party replication to S3/Iceberg, then BigQuery) with ClickPipes CDC streaming Postgres and MongoDB directly into ClickHouse Cloud, cutting analytics freshness from three hours to under two minutes, with most queries sub-second, at about 66% lower cost. MongoDB documents land in ClickHouse's native JSON type, which enables schema-on-read dot-notation access, and over 2,000 incremental materialized views built with dbt replace any orchestrator. Moving a lagInFrame plus ASOF JOIN window computation into insert-time materialized views cut per-query memory by 80% on an 838M-row table, and 60-98% across other query shapes. Tenant isolation for the Cue LLM agent is enforced through empty service users, versioned RBAC roles, session variables set by the MCP backend, and row policies, so the design fails closed and resists prompt injection.
- How Hud is building the first runtime code sensor with ClickHouse Cloud
ClickHouse mediumAdept
Hud, a runtime code sensor that tracks function-level behavior in production, moved its telemetry enrichment pipeline from a Node.js service plus Redis state machine into ClickHouse Cloud itself. Null engine tables and dictionaries handle in-memory enrichment, and ReplacingMergeTree tables act as a queue-like buffer that holds telemetry arriving before its metadata, with stale rows expiring automatically. Removing Redis eliminated network round-trips and memory pressure. The pipeline now ingests hundreds of MB/s of raw JSON, which compresses to tens of MB/s, stores over 11 TB, and detects degradations within minutes of a release. Hud originally left Postgres for ClickHouse because of its columnar layout and support for high cardinality.
- Using ClickHouse UDFs to integrate with OpenAI models
ClickHouse mediumAdept
ClickHouse executable user-defined functions can call the OpenAI chat completions API from SQL, adding sentiment labels or extracted entities to rows at insert or query time. The walkthrough starts with a Bash script and then moves to a Python script with retries and exponential backoff, configured as an executable_pool with chunk headers for parallel, batched invocation. Applying the UDF only to final result rows keeps API calls few, since OpenAI latency far exceeds ClickHouse query time. Aggregating sentiment across many rows means thousands of API calls, so rate limits and latency become the main constraints.
- Announcing the new ClickHouse SQL Playground
ClickHouse mediumAdept
sql.clickhouse.com is a new public SQL playground offering over 35 datasets (60 TB) and 220 example queries, with syntax highlighting, autocomplete, query parameters, basic charting via Apache ECharts and shareable links. It is a NextJS/React single-page app talking directly to ClickHouse's HTTP interface. Read-only credentials are exposed safely by combining RBAC, query complexity limits (10 billion rows read, 1000 rows returned) and per-IP quotas of 60 queries per hour. The service runs on a fixed 3-node, 30-vCPU ClickHouse Cloud cluster backed by object storage. Live query progress polls system.processes every 100ms by query ID under a separate monitor user, avoiding HTTP progress headers that the browser fetch API can't read.