Executable UDFs are now generally available on ClickHouse Cloud
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.
Related posts
- Executable UDFs are now in public beta on ClickHouse Cloud
ClickHouse mediumAdept
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.
- 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.
- 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.
- Why ClickHouse Cloud wins at real-time analytics
ClickHouse mediumAdept
In the CostBench streaming benchmark (113.2 billion stock quotes ingested at about 1M rows/s while queries ran), ClickHouse Cloud scored 412× to 1,996× better end-to-end performance per dollar than Snowflake, Databricks, BigQuery and Redshift Serverless. Its lead comes from sorting data and computing incremental materialized-view pre-aggregations in memory at insert time, so summaries never lag behind raw data. Background part merges then keep combining the mergeable aggregation states. Ingestion and merging are parallelized across nodes, cores and SIMD lanes, and a 4-core ingest service prepared all the data for $28.69 with 14.4× compression, while the other systems needed separate asynchronous refresh stages that lagged and cost $79–$696.
- Announcing On-Demand Compute: Instant compute for your most intensive workloads
ClickHouse easyNovice
ClickHouse Cloud On-Demand Compute, now in private preview, lets a query run on a shared pool of ClickHouse workers outside the service's own cluster by setting make_distributed_plan and distributed_plan_workers_num. It uses a new multistage distributed execution framework and a cost-based optimizer. Workers are leased for at least 60 seconds and reused by later queries without cold start, and concurrent queries share workers so the pool grows to the largest single request. On TPC-H SF10, it beat a 5-node autoscaling cluster on complex queries and matched it at 25 concurrent queries using 50% less compute, though short simple reads still favor the stateful cluster.