So I am pretty new to hive/sql, trying to figure out how to transform this data. I have data that looks something like this : raw_table
Owner | Team | Success | Fail |
---------------------------------
C1 | T1 | 90% | 5% |
C1 | T2 | 70% | 15% |
C1 | T3 | 10% | 55% |
What I want to turn it into is
Owner | T1_Success | T1_Fail | T2_Success| T2_Fail | T3_Success| T3_Fail
------------------------------------------------------------------------
C1 | 90% | 5% | 70% | 15% | 10% | 55%
To me, it makes more sense to group all the stats about the owner this way.
However, the number of teams is dynamic so what is typically recommended for static pivot is not applicable here I think (Actually I am not even sure if I should use pivot)
So I was wondering what is the simplest way to achieve this type of a table.
Since I am trying to do this in hive, was wondering if there is an easy way of doing this