I'm not really sure how to phrase this question, so please redirect me if there is a better place for this question.
Right now I have a data structure, more or less organized like this:
I want my data to look like this:
Sorry for the images, apparently I can't use markdown to make these!
I realize my question is similar to this one, but ideally I would like to be able to do this in Pig, but knowing how to do it in Hive, R, Python, or Excel/LibreCalc would be useful/interesting too.
I'm not even sure what this kind of data manipulation is called, so directing me to some sort of general wiki page would be helpful.
@vkp got me started in the right direction, but I had to add a few tweaks to get it working on Hive:
Still interested in a solution that works on Pig.
I am not sure if this will work in Hive. I know it is pretty similar to SQL. Give it a try.