v.21.1New Features
Added accurateCastOrNull function and type conversions in x IN (subquery) expressions
Added functionaccurateCastOrNull. This closes #10290. Add type conversions inx IN (subquery)expressions. This closes #10266. #16724 (Maksim Kita).
Why it matters
TheaccurateCastOrNull 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 functionaccurateCastOrNull 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.