Actually I need to port some SQL queries to hive QL.
Lets say I have hive table t which has columns mobile_no, cookie, ip,
Lets say I want to count unique users. My definition of of unique user = all
unique mobile numbers + all unique cookie (if for them mobile number not
present) + all unique ip ( where both mobile number and cookie is not
mobile_no, cookie, ip , access_id
'9741112345', '', '184.108.40.206', 1 // may be from sms so cookie is not present
'9741112346', '', '220.127.116.11', 2
'', 'aa', '18.104.22.168', 3
'', 'bb', '22.214.171.124', 4
There are 6 unique users .
in MySQL we can handle like
select count(distinct if(mobile_no !='', mobile_no, if(cookie != '',
cookie,ip)) from table.
Is it possible to do the same thing in Hive in one query itself?
To be more specific can I do IF (control functions) in Hive?