hive行列转换
来源:互联网 发布:摄影测量数据处理软件 编辑:程序博客网 时间:2024/05/01 03:20
1.行专列
表数据:
name ,subject ,score
xiaoming|english|92.0
xiaoming|chinese|98.0
xiaoming|math|89.5
huahua|chinese|80.0
huahua|math|89.5
hive (hive)> select name,concat_ws(',',collect_set(concat(subject,'=',score))) from student group by name;
huahua chinese=80,math=89.5
xiaoming english=92,chinese=98,math=89.5
2、列转行
表数据
name ,subject_score_list
huahua|chinese=80,math=89.5
xiaoming|english=92,chinese=98,math=89.5
hive (hive)> select name, subject_list from student2 stu2 lateral view explode(split(stu2.subject_score_list,','))stu_subj as subject_list;
huahua chinese=80
huahua math=89.5
xiaoming english=92
xiaoming chinese=98
xiaoming math=89.5
0 0
- hive行列转换总结
- hive UDAF行列转换
- hive行列转换
- hive sql 行列转换
- Hive行列转换-lateral view的使用
- Hive典型应用场景之行列转换
- hive collect_set,lateral view,explode 实现行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 行列转换
- 对 Xcode 菜单选项的详细探索
- java 读写 模板文件-分享
- 关于ZendStudio 12.0.2的破解 包括mac
- php小知识总结
- 中国5万吨大型补给舰罕见公开:美日冷汗
- hive行列转换
- hdu 3466 Proud Merchants 01背包 (顺序性)
- 白宫吃惊:中国突然曝光003型核航母动向
- Win7下面设置Eclipse所加载JAVA_HOME的路径
- LightOJ 1078 - Integer Divisibility【同余】
- 网络处理器
- 全栈工场实训13---Android---消息总线机制
- Qt Model+View+Delegate
- centos 6.5 安装 python pip