Currently nullif(null,y) throws exception in verification. This is because translates nullif(x,y) to a case-when expression, just like "case when x = y then null else x". So when "x" is null literal,a exception throws out as follow:
I have test in mysql,"nullif(null,y) works well.So I think we should allow this usage of "nullif".
There are two ways to fix this issue:
1) Skip the check for "foundNotNull" in SqlCaseOperator#checkOperandTypes:
However, as the comment says, we cannot have all of the THEN and ELSE returning null.
2) Disable the translation from nullif to case-when and keep "nullif" as it is.
Any suggestion is welcomed,Thanks!