蜂巢列转置

时间:2018-05-02 10:21:06

标签: hive hiveql

我在hive的表中有5列,如下所示:

5314|43045.9637152778   0       app_3   1       app_other
5314|43045.9637152778   0       app_9   1       app_other
5314|43045.9637152778   0       app_18  1       app_other
5314|43045.9637152778   0       app_2   1       app_other
5314|43045.9637152778   0       app_12  1       app_other

我想将上述数据转换为带有标题的以下输出:

id                      app_3   app_9   app_18  app_2   app_12  app_other
5314|43045.9637152778   0       0       0       0       0       1

我想将col3值作为列名,将col2值作为col3的值。你能帮我解决一下这个问题吗?

感谢。

0 个答案:

没有答案