v.24.9Experimental Feature

Improve castOrDefault for Non-Convertible Inner Types in Variant/Dynamic Columns

Improve castOrDefault from Variant/Dynamic columns so it works when inner types are not convertible at all. #67150 (Kruglov Pavel).
Improved castOrDefault function for Variant and Dynamic columns to handle cases where inner types are not convertible.

Why it matters

This enhancement resolves issues when using castOrDefault on Variant or Dynamic columns whose inner data types cannot be converted to the target type. It provides more robust and predictable casting behavior by returning the default value instead of failing or producing errors.

How to use it

Use the castOrDefault function as usual on Variant or Dynamic columns. The improved behavior is automatic and requires no additional configuration; it safely returns a default value if the inner type conversion is not possible.