I have two datasets: 1)
Table A
id name
1 raju
2 ramu
2 ramu
3 rakesh
2)
Table B
id Status
1 Y
1 Y
2 N
2 N
2 Y
3 N
I want to perform a left outer join (Table A Left outer join Table B) in hive in such a way that while joining the two datasets on column 'id', if the Status column in table B has 'Y' at least once, then the resultant dataset will have the Status as 'Yes' like below:
Final Result:
id name Status
1 raju Yes
2 ramu Yes
2 ramu Yes
3 rakesh No
I do not want to increase the number of records in the result while performing the join. The result table should have only 4 records, not 5(increased records based on the matching join condition).
How do I achieve this?