I am a beginner with Hive. I have two Hive tables as follows:
Table A contains columns - date, name, age.
Range for values in the date column from Table A is from 20150406 to 20150408.
Table B is a copy of Table A - but with one more new column added - date, name, **dept**, age
Range for values in the date column from Table B is from 20150409 to 20150411.
I would like to create a view using Tables A and B such that
View A =
Table A(date, name, dept as NULL, age) //for dates 20150406 to 20150408
UNION
Table B(date, name, dept, age) //for dates 20150409 to 20150411
Example:
Table A
date | name | age
20150406 | John | 21
20150407 | Jane | 23
20150408 | Mary | 20
Table B
date | name | dept | age
20150409 | Claire | CSE | 25
20150410 | Cindy | Maths | 27
20150408 | Tom | Biology | 30
View A
date | name | dept | age
20150406 | John | NULL | 21
20150407 | Jane | NULL | 23
20150408 | Mary | NULL | 20
20150409 | Claire | CSE | 25
20150410 | Cindy | Maths | 27
20150408 | Tom | Biology | 30
Is this feasible? How can this be done?
Thanks in advance!