hive <=> operator
03 Oct 2014Human being learns all the time … I’ve just found out that there is a wonderfully simple way of writing equal conditions including NULL values in Hive: the <=> operator. I used to write something like this:
...
WHERE
column1 = column2 OR (column1 IN NULL AND column2 IS NULL)
Now it boils down to:
WHERE
column1 <=> column2
For reference: NULL = NULL is false by definition in SQL