pyflink.table.expression.Expression.if_null#
- Expression.if_null(null_replacement) pyflink.table.expression.Expression [source]#
Returns null_replacement if the given expression is null; otherwise the expression is returned.
This function returns a data type that is very specific in terms of nullability. The returned type is the common type of both arguments but only nullable if the null_replacement is nullable.
The function allows to pass nullable columns into a function or table that is declared with a NOT NULL constraint.
e.g. col(“nullable_column”).if_null(5) returns never null.
New in version 1.12.0.