首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Hive优化器原理与源码解析系列--优化规则AggregateProjectPullUpConstantsRule(十七)

final Aggregate aggregate = call.rel(0); final RelNode input = call.rel(1); final int groupCount = aggregate.getGroupCount...key, constants.get(ref)); } } if (map.isEmpty()) { //如果groupBy引用的字段,都不是常量,则退出优化 return; } if (groupCount...移除第一个元素在这里不是最优的,不过,它将允许我们使用下面的快速路径(只需修剪groupCount)。 创建上拉的Aggregate聚合操作,移除聚合中使用的常量。...newAggCalls.add( aggCall.adaptTo(input, aggCall.getArgList(), aggCall.filterArg, groupCount...aggregate.getRowType().getFieldList()) {//遍历聚合的字段列表 RexNode expr; final int i = field.getIndex(); if (i >= groupCount

1.3K10

hadoop MapReduce编写一个分组统计并排序查询-分组

2015-05%' GROUP BY salesman ORDER BY totalmoney DESC; 将数据从mysql中导出,并且导出成文本,文本数据,将导出的文本上传到hdfs中,放在根据经下的groupcount-in...在Eclipse创建项目,编写一个GroupCount类,下面是类代码: GroupCount.java此类将数据提取出来,然后按销售员分组输出 package gruopcount; import...Override     public int run(String[] arg0) throws Exception {         Job job=Job.getInstance(getConf(), "groupcount...        String[] args2=new String[4];         args2[0]="ss";         args2[1]="hdfs://192.168.1.55:9000/groupcount-in.../t_product_sales.txt";         args2[2]="hdfs://192.168.1.55:9000/groupcount-out";         args2[3]="

96620
领券