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', '', '126.96.36.199', 1 // may be from sms so cookie is not present
'9741112346', '', '188.8.131.52', 2
'', 'aa', '184.108.40.206', 3
'', 'bb', '220.127.116.11', 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?