0

I need to load data from table of one Hive Database A into table of another Hive Database B.

This will be a cron job doing it periodically. Please consider the below cases and let me know how can this be done: Case 1: A & B are in same server. Case 2: A & B are in different servers.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Vvk
  • 41
  • 1

1 Answers1

0

You can use Oozie for scheduling the jobs.
If you want to store results of a query in a table in Hive then

1.Create a schema of the temp table using command CREATE TABLE ..
2.Execute the following command INSERT OVERWRITE TABLE temp_tablename SELECT * FROM table_name limit 10

Source here
Hope it helps!

Mr.Chowdary
  • 3,389
  • 9
  • 42
  • 66
  • Hi Mr.Chowdary, The above statement helps us to transfer the data between tables of same hive. How can we do for the tables in different hives(databases). we need to do something like "use foohive" . This is where I'm stuck. – Vvk Dec 05 '14 at 08:56
  • @Vvk [This](http://stackoverflow.com/questions/26636839/how-to-copy-all-hive-table-from-one-database-to-other-database) may help you. Please check it once. – Mr.Chowdary Dec 05 '14 at 09:34