v.21.11New Features
Added accurateCastOrDefault function and resolved issue #21330
Added function accurateCastOrDefault(x, T). Closes #21330. Authors @taiyang-li. #23028 (Maksim Kita).
Why it matters
This feature addresses the need for safer and more accurate type conversions by allowing users to cast a valuex to a target type T and return a default value if the cast fails, preventing query errors and improving robustness.How to use it
Use the function in your queries asaccurateCastOrDefault(x, T), where x is the value to cast and T is the target data type. This will attempt to cast x to type T and return a default value on failure.