Hive - Unpivot functionality in hive
问题 I have two table as follows: Table A userid | code | code_name | property_id 0001 | 1 | apple_id | Y1234 0031 | 4 | mango_id | G4567 0008 | 3 | grape_id | H1209 00013 | 2 | peach_id | Z5643 Table 2 apple_id | mango_id | grape_id | peach_id | new_id Y1234 | R1890 | | | N456098 | G4567 | | B3490 | N002345 T3336 | | H1209 | F3467 | N129087 | D7865 | J6543 | Z5643 | N109876 Desired Resultant table userid | new_id 0001 | N456098 0031 | N002345 0008 | N129087 00013 | N109876 Using the code_name in