v.21.1Improvements
Add Support for Modifying Key Column Types in ClickHouse
Add ability to modify primary and partition key column type fromLowCardinality(Type)toTypeand vice versa. Also add an ability to modify primary key column type fromEnumXtoIntXtype. Fixes #5604. #18362 (alesapin).
Why it matters
This feature addresses limitations in altering key column types by allowing users to convert betweenLowCardinality wrapped types and their base types, and to change EnumX types to integer types for primary keys. It enhances schema flexibility and simplifies key management in ClickHouse.How to use it
Use theALTER TABLE command to modify the column type of primary or partition keys between LowCardinality(Type) and Type, or from EnumX to IntX in the primary key. This enables schema changes without the need to recreate tables.