ClickHouse Release 24.9
ClickHouse 24.9 ships 23 features, 14 performance optimisations and 76 bug fixes. Refreshable materialized views gain an APPEND mode that adds rows instead of replacing the view, which is useful for periodic snapshots of streaming aggregates. Schema inference can now produce Variant types via input_format_try_infer_variants, though values that can all be cast to String still infer as String unless a schema hint is supplied. Other additions include distinctJSONPaths, distinctJSONPathsAndTypes and distinctDynamicTypes aggregate functions for JSON/Dynamic data, a _headers virtual column for the url table function, and an overlay string function.
Related posts
- ClickHouse Release 24.8 LTS
ClickHouse mediumAdept
ClickHouse 24.8 is a Long Term Support release (supported for 12 months) with 19 new features, 18 performance optimisations and 65 bug fixes. Headline additions include an experimental JSON data type built on Variant and Dynamic, a table engine for time-series data, exactly-once processing of Kafka messages, and join improvements. The JSON type is shown in detail: dot syntax reads literal paths efficiently, `.^` returns subobjects, `.:Type` and `::Type` assume or cast types, and `SKIP`, `SKIP REGEXP` and per-path type hints control what is stored. A new `deduplicate_merge_projection_mode` setting controls how projections behave when ReplacingMergeTree or AggregatingMergeTree merges drop or fold rows. Previously, projections either silently fell out of sync or blocked those operations.
- ClickHouse Release 24.1
ClickHouse mediumAdept
ClickHouse 24.1 ships 26 features, 22 performance optimisations and 47 bug fixes. Highlights include an experimental Variant type, a discriminated union of nested columns that lets maps, arrays and CSV schema inference hold mixed types, read back per type with variantElement. New Damerau-Levenshtein, Jaro and Jaro-Winkler similarity functions join the existing Levenshtein distance, demonstrated by finding typosquatting domains in the 7M-row Tranco list. The release also adds a vertical algorithm that speeds up FINAL queries on ReplacingMergeTree tables.
- ClickHouse Newsletter April 2022: JSON, JSON, JSON
ClickHouse mediumAdept
ClickHouse 22.3 LTS adds an experimental JSON data type that stores semi-structured documents in a single column, with dynamic subcolumns underneath, so you no longer need hand-built schemas of arrays and materialized columns. The worked examples cover querying nested fields, loading files with the JSONAsString format, and pulling a timestamp into its own column so MergeTree has a usable sorting key. They also show how to display field names with output_format_json_named_tuples_as_objects. The release also ships ARM Docker images, fully tested S3 disk storage (with known performance issues), and a Hive table function, and ClickHouse Cloud's serverless waitlist is now open.
- Accelerating ClickHouse queries on JSON data for faster Bluesky insights
ClickHouse mediumAdept
Incremental materialized views feeding AggregatingMergeTree tables cut ClickHouse dashboard queries over 4+ billion Bluesky JSON documents (1.6 TiB) from 44–56 seconds to 3–7 ms. Partial aggregation states are computed only for newly inserted rows and merged in the background, so the pre-aggregated tables stay tiny (e.g. 892 rows, 11 KiB) and constant-size regardless of source growth. Query latency therefore stays flat as the source table grows, and memory drops from ~776 MiB to ~186 KiB per query. Three dashboard scenarios cover count, uniq-based unique-user counts and top-reposted posts, with DDL, materialized view definitions and execution statistics; the reposts dashboard runs with a 5-second delay.
- Getting Data Into ClickHouse - Part 2 - A JSON detour
ClickHouse mediumAdept
ClickHouse's experimental JSON (Object('json')) type, introduced around 22.8, stores semi-structured rows by automatically inferring sub-columns and representing them internally as Tuples with minimal-width numeric types. It is demonstrated on the 28M-row Hacker News dataset via the JSONAsObject and JSONAsString formats. Because JSON sub-columns cannot serve as primary keys or carry codecs, the recommended pattern is a hybrid schema: declare stable fields like time and type explicitly so they can be used in ORDER BY, and keep the rest in a JSON column. That change cut a sample query from 2.6s to 0.74s. Inferred types widen transparently as new values arrive, but a single string value can silently convert a numeric column to String, so clean the data or declare critical columns explicitly.