Support Questions

Find answers, ask questions, and share your expertise

Duplicating data in hive table

avatar
New Contributor

I have a hive table with as_of_date as partition column with date 01/01/2017.I need to duplicate the data for rest of the dates..say 01/02, 01/03 etc. I mean the data remains same and the as_os_date keep changing. Can someone tell me what is the bes approach in duplcating the data for other dates?

1 REPLY 1

avatar
Contributor

This: insert into <tname> partition pcol = "01/02/.." select <cols> from <tname> where pcol = "01/01/2017"

You could also copy the partition folder and use "alter table add partition" the data files don't contain the partition column.