v.21.9Improvement
Add _CAST Function with Modified Nullability Preservation Rules
Add_CASTfunction for internal usage, which will not preserve type nullability, but non-internal cast will preserve according to settingcast_keep_nullable. Closes #12636. #27382 (Kseniia Sumarokova).
Why it matters
This feature addresses the need for an internal casting mechanism that ignores type nullability preservation to enable more flexible and predictable type conversions within ClickHouse internals. It solves inconsistencies related to nullability handling during casts and improves internal operation stability.How to use it
The_CAST function is intended for internal use only and does not require user configuration. Users can continue to use the standard CAST function, which preserves nullability based on the cast_keep_nullable setting. No changes are necessary for regular usage.