v.20.10Improvement

Add Support for Specialized Codecs in Columns with Subtypes

Add the ability to specify specialized codecs like Delta, T64, etc. for columns with subtypes. Implements #12551, fixes #11397, fixes #4609. #15089 (alesapin).
Added support for specifying specialized codecs such as Delta and T64 for columns with subtypes in ClickHouse.

Why it matters

This feature addresses the limitation of applying advanced compression codecs to columns that contain subtypes, improving compression efficiency and performance for complex data structures. It resolves several related issues and allows users to better optimize storage and query speed by leveraging specialized codecs on nested or composite data types.

How to use it

Users can specify the desired codec (e.g., Delta, T64) for columns with subtypes in the table schema definition using the CODEC clause. For example:

CREATE TABLE example (
col Nested(
x UInt32 CODEC(Delta),
y UInt64 CODEC(T64)
)) ENGINE = MergeTree() ORDER BY tuple();


This enables applying the specified codec directly to the subcolumns within nested or complex column types.