v.20.3New Feature

Added ifNotFinite Function for Syntactic Sugar

Added function ifNotFinite. It is just a syntactic sugar: ifNotFinite(x, y) = isFinite(x) ? x : y. #8710 (alexey-milovidov)
Added the ifNotFinite function, which returns its first argument if it is a finite number, otherwise returns a specified default value.

Why it matters

This function simplifies expressions where users need to handle non-finite values (such as Inf or NaN) by replacing them with a fallback value, improving readability and reducing boilerplate code.

How to use it

Use ifNotFinite(x, y) where x is the value to check and y is the fallback value returned if x is not finite. For example:

SELECT ifNotFinite(column, 0) FROM table