Created 02-03-2017 09:20 AM
There is no date field in this table but the "input_file_name" contains date & time. Ex: p_unicast.binary.ate.dk.20170117223832.947.dat hive> desc mi_data; OK input_file_name string p_id string r_name string i_name string o_tag string pre_value bigint crnt_value bigint pre_out_value bigint
Created 02-03-2017 11:54 AM
you have to partition the table by date, then you can delete older partitions.
Created 02-03-2017 07:17 PM
Is this an external table? if it is an external table then write a perl/shell script that runs daily based on a pattern it will remove files older than a certain date.
If it is not, and if it is a managed table with ORC/Parquet format, then it depends on how you load the table. While loading the table you could setup logic to populate the date in the table partition by that date and as @Avijeet Dash mentioned drop the partition that is 7 days old.