v.20.5New Feature
Add cast_keep_nullable setting for nullable type casting
Addcast_keep_nullablesetting. If setCAST(something_nullable AS Type)returnNullable(Type). #11733 (Artem Zuikov).
Why it matters
This feature addresses the need to preserve nullability during type casting. When casting a nullable value to another type, users often want to retain the nullable property instead of having it implicitly removed. This setting provides more control and prevents unexpected data loss or errors related to null handling.How to use it
Enable the feature by settingcast_keep_nullable = 1 in the query or session settings. After enabling, CAST operations on nullable data will preserve the nullable wrapper in the resulting type.