You can do something like this: CREATE table ABC_COPY LIKE ABC;
SHOW PARTITIONS ABC; for each partition: INSERT OVERWRITE ABC_COPY PARTITION(partkey = "$partkey") SELECT `(partkey)?+.+` FROM ABC WHERE partkey = "$partkey"; That back-quoted `(partkey)?+.+` is a special regular expression that matches every column except the partkey. Zheng On Tue, Jul 28, 2009 at 12:47 PM, Jason Michael<[email protected]> wrote: > I’d like to duplicate a very large, partitioned table in Hive, preserving > all data and partitions. What’s the most efficient way to do this? -- Yours, Zheng
