MapReduce处理通过采集的气象数据分析每年的最高温度
2018-5-3
| 2024-2-5
0  |  Read Time 0 min
type
status
date
slug
summary
tags
category
icon
password
数据来源于:NCDC 美国国家气候数据中心
这里是五条源数据:
对数据格式进行解释:
位置
数据
含义
1-4
0029
5-10
029070
USAF weather station identifie
11-15
99999
WBAN weather station identifier
16-23
19010108
观察日期
24-27
1300
观察时间
28
4
29-34
+64333
纬度(1000倍)
35-41
+023450
经度(1000倍)
42-46
FM-12
47-51
+0005
海拔
52-56
99999
57-60
V020
61-63
230
风向
64
1
质量代码
65
N
66-69
0118
70
1
质量代码
71-75
99999
云高(米)
76
9
77
9
78
N
79-84
000000
能见距离(米)
85
1
质量代码
86
N
87
9
88-92
\-0033
空气温度(摄氏度\*10)
93
1
质量代码
94-98
+9999
露点温度(摄氏度\*10)
99
9
质量代码
100-104
10320
大气压(hectopascals x10)
105
1
质量代码
我的代码是和书上一样的。依旧用的是三个class的代码框架,不多说直接上代码
新建一个MapReduce项目
先写job的代码
然后就是mapper
最后是reducer
然后导出jar包
notion image
查看自己需要计算的气温的文件,这里是1901,1902年的
notion image
然后就可以计算了直接运行jar包
notion image
notion image
出现上面这些信息则代表成功了
接下来查看输出结果
notion image
就可以看到自己需要结果了
年份
最高气温
1901
317
1902
244
  • 推荐
  • 实用教程
  • 大数据
  • linux配置GitHub并简单的操作gitMapReduce提取一条日志文件中的IP,并计算出访问的次数
    Loading...
    Catalog