Description
RexUtil.simplify() returns incorrect type information if the RexNode is a CASE(CONDITION, TRUE, FALSE). In this case, the CASE RexNode is a Boolean with isNullable == false. But, with the simplify, RexUtil.simplify returns CONDITION. When CONDITION has isNullable == true, the returned RexNode does not match the row type and fails to transform (vice versa).