之前帮朋友做一个数据集成的小项目,输入的文件格式类似如下:
Value1, Value2, Value3, ..... Value3......
Value3是重复的,输出的行应该是
Value1, Value2, Value3
.....
...
.
Value1, Value2, Value3
get(Fields.Out, "field1").setValue(clonedRow, value1);
get(Fields.Out, "field2").setValue(clonedRow, value2);
for(int i = 0; i < arrayOfField3.length; i++)
{
Object[] clonedRow = getInputRowMeta().cloneRow(r);
clonedRow = createOutputRow(clonedRow, clonedRow.length);
//Some transform logic
get(Fields.Out, "field3").setValue(clonedRow, arrayOfField3[i]);
putRow(data.outputRowMeta, clonedRow);
}