title: Hive: Joining two tables with different keys
body: <p>I have two tables like below. Basically i want to join both of them and expected the result like below. </p>
  
  <p>First 3 rows of table 2 does not have any activity id just empty. </p>
  
  <p>All fields are tab separated. Category "33" is having three description as per table 2.  </p>
  
  <p>We need to make use of "Activity ID" to get the result for "33" category as there are 3 values for that.</p>
  
  <p>could anyone tell me how to achieve this output?</p>
  
  <h1>TABLE: 1</h1>
  
  <p>Empid   Category    ActivityID</p>
  
  <p>44126   33  TRAIN</p>
  
  <p>44127   10  UFL</p>
  
  <p>44128   12  TOI</p>
  
  <p>44129   33  UNASSIGNED</p>
  
  <p>44130   15  MICROSOFT</p>
  
  <p>44131   33  BENEFITS</p>
  
  <p>44132   43  BENEFITS</p>
  
  <h1>TABLE 2:</h1>
  
  <p>Category    ActivityID  Categdesc</p>
  
  <p>10      billable</p>
  
  <p>12      billable</p>
  
  <p>15      Non-billable</p>
  
  <p>33  TRAIN   Training</p>
  
  <p>33  UNASSIGNED  Bench</p>
  
  <p>33  BENEFITS    Benefits</p>
  
  <p>43      Benefits</p>
  
  <h1>Expected Output:</h1>
  
  <p>44126  33  Training</p>
  
  <p>44127  10  Billable</p>
  
  <p>44128  12  Billable</p>
  
  <p>44129  33  Bench</p>
  
  <p>44130  15  Non-billable</p>
  
  <p>44131  33  Benefits</p>
  
  <p>44132  43  Benefits</p>