- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Inserting data from multiple hive table to one one hive table.
- Labels:
-
Apache Hive
Created ‎08-07-2021 11:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am in the process to create one dernormalized table and feed this table from multiple hive tables so
my question is do I need to write multiple insert because there are total 13 tables but there is no single common column(field) in all of them.
Thanks
Sukrut
Created ‎08-08-2021 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you try the query something like below to insert the data from multiple tables?
insert into DemoTable1945(StudentName,StudentAge) select tbl1.Name,tbl2.Age from DemoTable1943 tbl1,DemoTable1944 tbl2;
Let us know if this helps.
Regards,
Chethan YM
Created ‎08-09-2021 08:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your update.
I have 10 hive tables and I am inserting data from these 10 tables to one hive denorm table but we have some conditions for few columns.
Here every column is coming from some table and I need to put populate the column only if certain condition is true for example if table has name,age,salary column and condition is like if salary is 1000 then populate name column.
INSERT INTO TABLE MANAGE(NAME,country)SELECT TABLENAME.NAME,TABLENAME.COUNTRY FROM TABLE1,TABLE2
How can I populate the name column with some condition.
