I need to retrieve the most recent week of data, regardless of when the data stopped being collected. Thus, instead of using the current date and minusing 7 I need to take the max date in the table and minus 7.
I am trying:
select * from my_table where datetime_column >= date_sub(max(datetime_column), 7)
But max date doesn't seem to be suported in HIVE.