IFNULL (Lakehouse v1)
If <expr1> is NULL, returns <expr2>, otherwise returns <expr1>.
Analyze Syntax
Section titled “Analyze Syntax”func.ifnull(<expr1>, <expr2>)Analyze Examples
Section titled “Analyze Examples”func.ifnull(null, 'b'), func.ifnull('a', 'b')
┌────────────────────────────────────────────────┐│ func.ifnull(null, 'b') │ func.ifnull('a', 'b') │├────────────────────────┼───────────────────────┤│ b │ a │└────────────────────────────────────────────────┘
func.ifnull(null, 2), func.ifnull(1, 2)
┌──────────────────────────────────────────┐│ func.ifnull(null, 2) │ func.ifnull(1, 2) │├──────────────────────┼───────────────────┤│ 2 │ 1 │└──────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”IFNULL(<expr1>, <expr2>)Aliases
Section titled “Aliases”SQL Examples
Section titled “SQL Examples”SELECT IFNULL(NULL, 'b'), IFNULL('a', 'b');
┌──────────────────────────────────────┐│ ifnull(null, 'b') │ ifnull('a', 'b') │├───────────────────┼──────────────────┤│ b │ a │└──────────────────────────────────────┘
SELECT IFNULL(NULL, 2), IFNULL(1, 2);
┌────────────────────────────────┐│ ifnull(null, 2) │ ifnull(1, 2) │├─────────────────┼──────────────┤│ 2 │ 1 │└────────────────────────────────┘