MapReduce之气象数据分析
问题描述
通过获取的气象数据来分析气温最大值
样例输入
数据集地址: 天气数据集
样例输出
表示1901年最大温度为239,可能是他们使用的温度单位和咱们不一样吧
mapper阶段任务
map阶段主要是对文本进行切割,提取时间和温度形成 <时间,<温度,,温度,温度>>的键值对
mapper阶段编码如下
public static class MaxTemperatureMapper extends Mapper<LongWritable,Text,Text,IntWritable>{
private static final int MISSING=9999;
public void map(LongWritable key,Text value,Context context) throws IOException,InterruptedException{
String line=value.toString();
String year=line.substring(