I am novice to Hive. Trying to get the previous day date using the below query:
SELECT MAX(id) FROM store_rcd_table
WHERE recon_dt = unix_timestamp(date_sub(from_unixtime(unix_timestamp(),
'yyyy-MM-dd'),1),'yyyy-MM-dd')
but getting the NULL as output. The output should have been date(2017-09-23) and MAX(id).
Also tried,
Select MAX(id) FROM store_rcd_table
WHERE recon_dt ='2017-09-24';
No output for this query also, just OK is coming as an output.
Not getting what the issue is? Any suggestion/ help is appreciated.
The structure of the table is:
id string
locationid string
mngrid string
empid string
deleted boolean
recon_dt string