Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 25 min read How-to mediumAdept

Training Machine Learning Models with ClickHouse

ClickHouse can serve as both the transformation engine and offline store in a virtual feature store, using the open-source Featureform as an orchestration layer. Exploration and feature engineering run as SQL at the data source, with no need to move data into frameworks like Spark, and results persist via INSERT INTO SELECT or views. A hands-on walkthrough deploys Featureform with ClickHouse in Docker, registers a Kaggle credit card fraud dataset, and defines versioned features. Those features are then used to train Logistic Regression and Decision Tree classifiers.

Related posts

  • Powering Feature Stores with ClickHouse

    ClickHouse easyNovice

    Feature stores centralize the storage, versioning and retrieval of ML features so the same data serves both model training and inference. They typically combine a data source, an optional transformation engine, an offline training store with point-in-time correctness, and a low-latency online store. Physical stores like Tecton are integrated but inflexible, literal stores like Feast only store and serve features, and virtual stores like Featureform orchestrate pluggable components. ClickHouse fits best inside a virtual store, where it can act as data source, transformation engine via Materialized Views, and offline store, shown through a new Featureform integration.

  • Modeling Machine Learning Data in OLAP databases

    ClickHouse mediumAdept

    ClickHouse can act as the transformation engine and offline store of an ML feature store, with features modeled as timestamped tables and assembled into point-in-time correct training sets. Using a 100m-row web analytics dataset and a bounce-prediction example, the walkthrough builds a deduplicated "feature subset" table with ReplacingMergeTree and a trimmed PRIMARY KEY, then keeps it current with incremental materialized views. Features are tied to entities such as user and domain, computed with GROUP BY aggregations, and joined into feature vectors via ASOF JOIN on key and timestamp proximity. The aim is fast iteration during feature engineering, which usually costs more time than model selection.

  • If it’s in your catalog, you can query it: The DataLakeCatalog engine in ClickHouse Cloud

    ClickHouse mediumAdept

    ClickHouse's DataLakeCatalog database engine connects to lakehouse catalogs such as AWS Glue and Databricks Unity Catalog, reads their metadata, and automatically maps each table to the matching Iceberg or DeltaLake table engine. Catalog tables can then be queried like native tables, including federated queries across catalogs. Supporting work includes a ClickHouse-native Parquet reader with page-level filtering and PREWHERE (1.8× faster on ClickBench), parallel execution distributed by Parquet file, a distributed cache, and a shared catalog for stateless compute. Demos show the setup SQL and a Glue-backed Iceberg query scanning 339M rows in 0.35s. Glue and Unity integration enters beta in ClickHouse Cloud 25.8.

  • Trillabit Utilizes the Power of ClickHouse for Fast, Scalable Results Within Their Self-Service, Search-Driven Analytics Offering

    ClickHouse easyNovice

    TrillaBit moved its search-driven BI platform from Apache Solr to ClickHouse after Solr proved weak at high-volume aggregation, compression, SQL maturity and joins, and chose ClickHouse over Snowflake on cost and the ability to self-host. The team relies on integration table engines (MySQL/Postgres for metadata lookups, Kafka for streaming IoT data, S3), ReplacingMergeTree to apply delta updates without duplicates, AggregatingMergeTree for incremental aggregation, and views that flatten raw Airbyte JSON with JSON_VALUE. It is now moving to ClickHouse Cloud to offload cluster management. Much of the post is a product pitch for Quick Intelligence's dashboards, embedding and ABAC-based multi-tenancy.

  • Analyzing Hugging Face datasets with ClickHouse

    ClickHouse mediumAdept

    Hugging Face's Datasets Server automatically converts every dataset to Parquet and exposes the file URLs through a REST endpoint, so clickhouse-local can query any dataset with plain SQL via the url function and URL table engine. The walkthrough uses a Spotify tracks dataset to show aggregations, varPop checks, and bar-function histograms, then moves to ClickHouse's statistical functions and a reusable UDF that queries a dataset by name alone. Practical gotchas include setting max_http_get_redirects = 1 to follow the CDN redirect and enable_url_encoding = 0 to preserve escaped paths. Slow reads caused by small Parquet row groups, each triggering a separate HTTP request, were fixed in ClickHouse issue 53069.

The quest for software engineering knowledge.

Look:
Layout: