Created 02-07-2017 10:31 AM
i want to delete the older partitons data more than 10 days. my script runs everyday. iam able to truncate the partitioned managed table with the current date but unable to truncate more than 10 days data from current date. Can anyone provide me the command to truncate the date with date a partitioned column for more than 10 days
Created 02-07-2017 04:34 PM
You may use the linux script to loop over the date that more than 10 days, and use "truncate table [tablename] partition [date partition]". And if you can run everyday, you just need to run one truncate.
Created 02-09-2017 12:38 PM
Hi Frank lu
Can you provide me the code with the example i didnt exactly what you are saying
Created 02-08-2017 02:43 AM
Hi Dinesh,
You can use this set hive.variable.substitute=true; set hiveconf:my_date=date_sub(current_date, 10); truncate table table_name parition (date=${hiveconf:my_date});
Hope this will help.
Regards
Niranjan