v.22.1Improvement

Correct Prevention of Nullable Primary Keys in ClickHouse

Correctly prevent Nullable primary keys if necessary. This is for #32780. #33218 (Amos Bird).
Improved validation to correctly prevent the use of Nullable columns as primary keys in ClickHouse tables.

Why it matters

This feature addresses the issue where Nullable columns were incorrectly allowed as primary keys. Preventing Nullable types in primary keys ensures data integrity and correct query execution, as primary keys must be non-nullable to guarantee uniqueness and indexing consistency.

How to use it

This validation is applied automatically when defining a primary key in table schemas. Users should avoid declaring Nullable columns as primary keys. If such a schema is attempted, ClickHouse will now correctly reject it, preventing invalid table configurations.