Best way to duplicate a partitioned table in Hive

A simple google search for the above will land you here:
http://grokbase.com/t/hive/user/097w0bsnne/best-way-to-duplicate-a-table

But, I believe a better way is:

  1. Create the new target table with the schema from the old table
  2. Use hadoop fs -cp to copy all the partitions from source to target table
  3. Run MSCK REPAIR TABLE table_name; on the target table
 
514
Kudos
 
514
Kudos

Now read this

Creating Presentations with Reveal.js

Late last year, I gave a talk at the Sift Science office in San Francisco on “Hadoop at Lookout - how Lookout uses the hadoop infrastructure to power internal analytics”. I used Reveal.js to present the talk in my browser! Reveal.js is a... Continue →