0

我有一个输入

ID  Employee    Salary
1   aaa         10000
2   aaa         15000
3   bbb         9000
4   bbb         23000
5   bbb         5000
6   cccc        12000
7   cccc        15000

我需要如下输出:

ID  Employee    Salary  Flag
1   aaa         10000   False
2   aaa         15000   True
3   bbb         9000    False
4   bbb         23000   True
5   bbb         5000    False
6   cccc        12000   False
7   cccc        15000   True

试过了tJavaRow。但我没有得到预期的结果。

4

1 回答 1

2

输入------>tJavaRow----->tLogRow

在 tJavaRow 中

if(input_row.EMP.equals(context.emp_temp) && input_row.SAL > context.sal_temp) {
output_row.ID = input_row.ID;
output_row.EMP = input_row.EMP;
output_row.SAL = input_row.SAL;
output_row.FLAG = "true";
}
else {

output_row.ID = input_row.ID;
output_row.EMP = input_row.EMP;
output_row.SAL = input_row.SAL;
output_row.FLAG = "false";
}

context.emp_temp = input_row.EMP;
context.sal_temp = input_row.SAL;
于 2017-07-13T06:11:36.573 回答