在上一个实验中我们筛选了竞赛网站日志数据中2021/1和2021/2的数据以序列化的形式写到了hdfs上。

接下来我们使用Java API 读取序列化的数据保存到磁盘中。
其他命令操作请参考:16 Java API操作HDFS-CSDN博客
1.我直接在上一个项目中test/java目录下创建com.maidu.selectdata.test.APITest类,test目录下的内容在打包时不会出现在jar文件中,仅供测试所用。

2.编写代码


3.运行 选择方法名右击运行

测试成功

4.进入D盘查看文件

写入文件的数据
