v.20.7New Feature

Allow Nullable Types as Keys in MergeTree Tables with Setting Enabled

Allow Nullable types as keys in MergeTree tables if allow_nullable_key table setting is enabled. Closes #5319. #12433 (Amos Bird).
Support for using Nullable data types as key columns in MergeTree tables when the allow_nullable_key setting is enabled.

Why it matters

Nullable types were previously disallowed as keys in MergeTree tables, limiting schema flexibility. This feature enables users to define key columns with Nullable types, allowing more expressive schemas and better handling of missing or optional data in primary keys.

How to use it

Enable the feature by setting the table setting allow_nullable_key = 1 when creating or altering a MergeTree table. This allows key columns to be defined with Nullable types.