Create an external table in HIVE with multiple sources

213 views Asked by At

I want to create an external table in HIVE which takes input from multiple databases. Eg: I want to create bigTable (A,B,C,D,E,F) with sources coming from db1.table1(A,B) and db2.table2(C,D,E,F,A)

Also, the bigTable has to update when db1.table1 and db2.table2 are updated.

Side Notes:

  1. The source tables are updated on daily basis.

  2. Field "A" is common field if we want to perform join on the tables.

Suggestions are open for scenario where there are no common fields between the sources.

1

There are 1 answers

0
Gaurav Khare On

Yes. I think you can create a view on the top of union of all the tables. something like create view veie_test as select * from A UNION select * from B ... so on.