Created 03-15-2017 09:44 AM
Hi,
I have below Hive query and its not giving me "equals" as output. Why?
hive> select case when (NULL=NULL) then "equals" else "not equals" end as value; OK not equals
Created 03-15-2017 10:05 AM
@Gnanasekaran G Use the following ( <=>) operator instead of (=) operator
SELECT CASE WHEN (NULL<=>NULL) THEN "equals" ELSE "not equals" end AS value;
Reference:
Created 03-15-2017 09:54 AM
check NULL is NULL instead of NULL = NULL. This worked for me.
Created 03-15-2017 10:05 AM
@Gnanasekaran G Use the following ( <=>) operator instead of (=) operator
SELECT CASE WHEN (NULL<=>NULL) THEN "equals" ELSE "not equals" end AS value;
Reference:
Created 03-16-2017 04:58 AM
@Gnanasekaran G if this helped, please vote/accept best answer. we can close the thread
Created 03-16-2017 05:39 AM
Thank you @Murali Ramasami @Sharmadha Sainath . It works for me now.
Created 03-16-2017 05:44 AM
Thanks @Gnanasekaran G please accept best answer. we can close the thread