1.WordCount(统计单词) 经典的运用MapReuce编程模型的实例 1.1 Description 给定一系列的单词/数据,输出每个单词/数据的数量 1.2 Sample a is b is not c b is a is not d 1.3 Output a: b: c: d: not: 1.4 Solution /** * Licensed under the Apache License, Version 2.0 (the "License"); * you may n…
1.利用SqlServer中的case when来把数据查询出来的数据替换成其它值显示 2.结果对比: 普通select查询出来的结果如下: 用了case when方法后显示结果如下: 3.具体使用代码如下: select cInvCode,cValueType, case when cValueType='全月平均法' then 'S' when cValueType='计划价法' then 'J' else '' end as cValueType ,isnull(iInvRCost,) f…
drop procedure if exists p_for_create_customer; create procedure p_for_create_customer()begin declare ii int default 0; declare i int default 1; declare minss int default 0; declare idd int; declare start_d datetime; declare channel_code_ VARCHAR(255…
1 public class TopK extends Configured implements Tool { public static class TopKMapper extends Mapper<Object, Text, NullWritable, LongWritable> { public static final int K = 100; private TreeMap<Long, Long> tm = new TreeMap<Long, Long>(…
public class GroupComparator implements RawComparator<MyBinaryKey> { @Override public int compare(MyBinaryKey o1, MyBinaryKey o2) { return o1.toString().compareTo(o2.toString()); } @Override public int compare(byte[] b1, int s1, int l1, byte[] b2, i…