Apache pig pig脚本有条件地打印数据集

Apache pig pig脚本有条件地打印数据集,apache-pig,Apache Pig,我们有两个数据集: 学生:此数据集包含一个班级中学生的姓名和卷号 结果:此数据集包含学生的卷号和结果(不及格或及格) 编写Pig脚本以分析给定的数据集,并打印成功通过考试的学生姓名。输入1-result.dat文件(id、状态) 输入2-student.dat文件(名称、id) re = load 'results.dat' as (id:int,status:chararray); st = load 'student.dat' as (name:chararray,id:int);

我们有两个数据集: 学生:此数据集包含一个班级中学生的姓名和卷号 结果:此数据集包含学生的卷号和结果(不及格或及格)

编写Pig脚本以分析给定的数据集,并打印成功通过考试的学生姓名。

输入1-result.dat文件(id、状态)
输入2-student.dat文件(名称、id)

re = load 'results.dat' as (id:int,status:chararray); 

st = load 'student.dat' as (name:chararray,id:int); 

join_re_st = join re by $0,st by $1; 

fil = filter join_re_st by $1 != 'fail'; 

result = foreach fil generate $0,$1,$2; 

Dump result;