目录
1.需求
在给定的文本文件中统计输出每一个单词出现的总次数
(1)输入数据
ss ss
cls cls
jiao shi wangwu cls
banzhang
xue
hadoop
(2)期望输出数据
banzhang 1
cls 3
hadoop 1
jiao 1
ss 2
xue 1
shi 1
wangwu 1
2、建立maven工程编写代码
1.配置在pom.xml文件中添加如下依赖
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>