Is there a way to get current date -1into Hive, then, yesterdays datealways? And in this format 20120805?
I can fulfill my request in such a way as to get data for yesterday date, since today it Aug 6this -
select * from table1 where dt = '20120805';
But when I tried to do this using date_sub functionto get yesterday's date, since the table below is split into a date column (dt).
select * from table1 where dt = date_sub(TO_DATE(FROM_UNIXTIME(UNIX_TIMESTAMP(),
'yyyyMMdd')) , 1) limit 10;
Is he looking for data in all sections? What for? Is there something wrong with what I am doing in my request?
How can I make an estimate in a subquery to avoid checking the entire table?
source
share