Transferring hive table from one database to anoth

2019-04-18 09:44发布

I need to move a hive table from one database to another. How can I do that?

标签: hive hiveql
8条回答
虎瘦雄心在
2楼-- · 2019-04-18 10:37

The database you want to migrate it would have provided you with a database connector. With the help of sqoop and the database connector, you could be able to migrate it. would be great if you are more specific about the type of database you want to migrate the data to

查看更多
再贱就再见
3楼-- · 2019-04-18 10:38

Since 0.14, you can use following statement to move table from one database to another in the same metastore:

use old_database;
alter table table_a rename to new_database.table_a

The above statements will also move the table data on hdfs if table_a is a managed table.

查看更多
登录 后发表回答