Skip to content

Commit

Permalink
only process tables that exist
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 9, 2012
1 parent 32a34eb commit d4938f4
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -158,17 +158,20 @@ public void write(CsvData data) {
}

List<TransformedData> dataThatHasBeenTransformed = new ArrayList<TransformedData>();
for (TransformTable transformation : activeTransforms) {
transformation = transformation.enhanceWithImpliedColumns(sourceKeyValues, oldSourceValues, sourceValues);
for (TransformTable transformation : activeTransforms) {
transformation = transformation.enhanceWithImpliedColumns(sourceKeyValues,
oldSourceValues, sourceValues);
dataThatHasBeenTransformed.addAll(transform(eventType, context, transformation,
sourceKeyValues, oldSourceValues, sourceValues));
}

for (TransformedData transformedData : dataThatHasBeenTransformed) {
Table table = transformedData.buildTargetTable();
this.targetWriter.start(table);
this.targetWriter.write(transformedData.buildTargetCsvData());
this.targetWriter.end(table);
CsvData csvData = transformedData.buildTargetCsvData();
if (this.targetWriter.start(table) || !csvData.requiresTable()) {
this.targetWriter.write(csvData);
this.targetWriter.end(table);
}
}

} else {
Expand Down

0 comments on commit d4938f4

Please sign in to comment.