I am running a hive query in sparksql that goes like this:
select GREATEST( CASE WHEN x1 = 2 then y1+3 else -1, case when x2 = 2