int rowNumber = 0;
while (dataSet.next()) {
Row row = dataSet.getRow();
InputRow inputRow = new MetaModelInputRow(rowNumber, row);
TransformedInputRow resultRow;
if (inputRow instanceof TransformedInputRow) {
// re-use existing transformed input row.
resultRow = (TransformedInputRow) inputRow;
} else {
resultRow = new TransformedInputRow(inputRow);
}
for (TransformerJobBuilder<?> tjb : transformerJobs) {
List<MutableInputColumn<?>> cols = outputColumns.get(tjb);
Object[] output = tjb.getConfigurableBean().transform(resultRow);
assert cols.size() == output.length;
for (int i = 0; i < output.length; i++) {
resultRow.addValue(cols.get(i), output[i]);
}
}
result.add(resultRow);
rowNumber++;