diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/transforms/RexConverter.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/transforms/RexConverter.kt index 8e94808a7f..44f4c0d25f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/transforms/RexConverter.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/transforms/RexConverter.kt @@ -345,8 +345,7 @@ internal object RexConverter { }.toMutableList() val defaultRex = rex(type = StaticType.NULL, op = rexOpLit(value = nullValue())) - branches += rexOpCaseBranch(bool(true), defaultRex) - val op = rexOpCase(branches) + val op = rexOpCase(branches, defaultRex) rex(type, op) } @@ -363,9 +362,8 @@ internal object RexConverter { val call = rexOpCall(fn, listOf(expr1, expr2)) val branches = listOf( rexOpCaseBranch(rex(type, call), rex(type = StaticType.NULL, op = rexOpLit(value = nullValue()))), - rexOpCaseBranch(bool(true), expr1) ) - val op = rexOpCase(branches.toMutableList()) + val op = rexOpCase(branches.toMutableList(), expr1) rex(type, op) }