Skip to main content
ryu
Gold ⭐️
Aug 9, 2021 5:19 PM UTC
Question

How to properly copy hive tables from one cluster to another?

Hi experts,

We are trying to copy hive tables from one cluster to another to do some testing.

What is the proper way of doing this?

 

Is it possible to distcp the hive tables at the hdfs level first and then somehow run a hive query to somehow have those hive tables recognized by hive?

 

Any help is much appreciated.

 

Thanks,

1 reply

HanzalaShaikh
Gold ⭐️
Aug 9, 2021 5:48 PM UTC

Hi @ryu ,

I have recently copied the hive tables from our Production cluster to non production cluster using distcp the location of hive warehouse directory from Prod to non prod, After running distcp we created the table schema  on non prod as same as Prod using 'create table'. If table consist partition then please apply 'alter table' to add partition.

 

We are also using hive replication to copy the tables from our Prod to DR cluster.

 

If this has helped you then please mark the answer as solution.

Translate