Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.2.0, 3.2.1, 3.3.0, 3.2.2, 3.3.1
-
None
Description
The DECODE function was implemented for Oracle compatibility. It works similar to CASE expression, but it is supposed to have one major difference: NULL == NULL
https://docs.oracle.com/database/121/SQLRF/functions057.htm#SQLRF00631
The Spark implementation does not observe this however:
select decode(null, 6, 'Spark', NULL, 'SQL', 4, 'rocks');
NULL
The result is supposed to be 'SQL'