如何将所有配置单元表从一个数据库复制到其他数据库 [英] How to copy all hive table from one Database to other Database
问题描述
我在hive表中有默认数据库,其中包含80个表。
我创建了另外一个数据库,并且我想将所有表从默认数据库复制到新的数据库中。
是否有任何方法可以从一个数据库复制到其他数据库,而无需创建单独的表。
请让我知道是否有解决方案。 。
在此先感谢
我可以考虑几个选项。
-
使用CTAS。
CREATE TABLE NEWDB.NEW_TABLE1 AS select * from OLDDB.OLD_TABLE1;
CREATE TABLE NEWDB.NEW_TABLE2 AS select * from OLDDB.OLD_TABLE2;
...
-
使用Hive
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+ImportExport
希望这有帮助。
I have default db in hive table which contains 80 tables .
I have created one more database and I want to copy all the tables from default DB to new Databases.
Is there any way I can copy from One DB to Other DB, without creating individual table.
Please let me know if any solution.. Thanks in advance
I can think of couple of options.
Use CTAS.
CREATE TABLE NEWDB.NEW_TABLE1 AS select * from OLDDB.OLD_TABLE1; CREATE TABLE NEWDB.NEW_TABLE2 AS select * from OLDDB.OLD_TABLE2; ...
Use IMPORT feature of Hive https://cwiki.apache.org/confluence/display/Hive/LanguageManual+ImportExport
Hope this helps.
这篇关于如何将所有配置单元表从一个数据库复制到其他数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!