在此案例中,我们使用学生成绩实现分区功能(第三列为成绩):
- 将原始数据上传至HDFS
[root@hadoop01 test_data]# hdfs dfs -mkdir /test_partition_input
[root@hadoop01 test_data]# hdfs dfs -put test_partiton.csv /test_partition_input
新建project:
- 引入pom依赖
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>wyh.test</