Hive(十八)--全局排序
来源:互联网 发布:windows镜像下载网站 编辑:程序博客网 时间:2024/05/22 16:07
不分发数据,使用单个reducer
set mapred.reduce.tasks=1;select * from dw.dw_app where dt>='2016-09-01' and dt <='2016-09-18' order by stimelimit 30000;
包多一层,是用order by
select t.* from (select *from dw.dw_app where dt>='2016-09-01' and dt <='2016-09-18' and app_id='16099'and msgtype = 'role.recharge' ) torder by t.stime limit 5000;
把所有具有相同的行最终都在一个reducer分区中,在在一个reducer中排序。 cluster by column=distribute by column+sort by colum
select * from dw.dw_app where dt>='2016-09-01' and dt <='2016-09-18' and app_id='16099'and msgtype = 'role.recharge' cluster by dtlimit 30000;
查询每天前十名充值用户和充值总额
select t3.* from (select t2.* from (select dt, account_id, sum(recharge_money) as total_money, row_number() over(partition by dt order by sum(recharge_money) desc) rank from (select dt, account_id, recharge_money from dw.dw_app where dt >= '2016-09-01' and dt <= '2016-09-18' and app_id = '16099' and msgtype = 'role.recharge' cluster by dt, account_id) t group by dt, account_id) t2 where t2.rank <= 10) t3 order by t3.dt asc, rank asc limit 300;
阅读全文
0 0
- Hive(十八)--全局排序
- Hive优化----十八个问题
- 十八、Hive 中UDF编程
- hive优化 全局排序 join 笛卡尔积 exist in reduce数量 合并mapreduce
- [一起学Hive]之十八-Hive UDF开发
- [一起学Hive]之十八-Hive UDF开发
- Hadoop全局排序
- Hadoop全局排序
- MapReduce TotalOrderPartitioner 全局排序
- mapreduce实现全局排序
- MapReduce TotalOrderPartitioner 全局排序
- MapReduce TotalOrderPartitioner 全局排序
- MapReduce TotalOrderPartitioner 全局排序
- MapReduce TotalOrderPartitioner 全局排序
- hadoop全局排序思路
- mapreduce 全局排序
- 【十八】排序算法(四)--归并排序
- hive 全排序优化
- 熵的通俗理解
- SpringBoot集成Rabbit使用TopicRabbit指定发送集合
- Spring之ioc操作与属性注入
- 输出100-500之间的水仙花数
- 数据库
- Hive(十八)--全局排序
- codevs 1079 回家 Floyd 解题报告
- StringBoot集成Rabbit,根据业务返回ACK
- windows环境下通过c++使用redis
- SpringBoot 序列化器注解使用方法
- 代理模式
- 【网络流24题】汽车加油行驶(分层图+最短路)
- Spring Boot配置拦截器
- Oaecle 命令行基础操作篇(4)