v.21.1New Features

Added accurateCastOrNull function and type conversions in x IN (subquery) expressions

Added function accurateCastOrNull. This closes #10290. Add type conversions in x IN (subquery) expressions. This closes #10266. #16724 (Maksim Kita).
Introduced the accurateCastOrNull function and enabled type conversions within x IN (subquery) expressions.

Why it matters

The accurateCastOrNull function improves type casting accuracy by returning NULL instead of errors when casts fail, enhancing query robustness. Support for type conversions in x IN (subquery) expressions resolves previous limitations, allowing more flexible and reliable comparisons between different data types.

How to use it

Use the function accurateCastOrNull to safely cast values with:

SELECT accurateCastOrNull(value, 'TargetType')


Type conversions in x IN (subquery) expressions are automatically applied, enabling queries like:

SELECT * FROM table WHERE column IN (SELECT another_column FROM other_table)

where implicit conversions handle type mismatches.