IF (Lakehouse v2)
Returns one of two values depending on whether a condition is TRUE or FALSE.
Analyze Syntax
Section titled “Analyze Syntax”func.if_(get_column(table, 'score') >= 60, 'Pass', 'Fail')Analyze Examples
Section titled “Analyze Examples”func.if_(get_column(table, 'score') >= 60, 'Pass', 'Fail')SQL Syntax
Section titled “SQL Syntax”IF(<score> >= 60, 'Pass', 'Fail')SQL Examples
Section titled “SQL Examples”SELECT name, IF(score >= 60, 'Pass', 'Fail') AS result FROM students;
┌─────────┬────────┐│ name │ result │├─────────┼────────┤│ Alice │ Pass ││ Bob │ Fail ││ Charlie │ Pass │└─────────┴────────┘