v.24.4Experimental Feature
Mark Variant Type as Comparable for Primary Key Use
Mark type Variant as comparable so it can be used in primary key. #62693 (Kruglov Pavel).Why it matters
Previously, theVariant type could not be used in primary keys because it was not comparable. This feature allows users to leverage the flexibility of Variant within primary keys, improving indexing and query performance for semi-structured data.How to use it
Users can now define a table with a primary key that includes columns of typeVariant. For example:CREATE TABLE example (
id UInt64,
data Variant,
PRIMARY KEY (data)
) ENGINE = ...;