Skip to content

Commit

Permalink
0002753: Optimize calls from TransformWriter to
Browse files Browse the repository at this point in the history
enhanceWithImpliedColumns
  • Loading branch information
mmichalek committed Aug 25, 2016
1 parent 418702d commit 60e080d
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -99,9 +99,15 @@ public void start(Batch batch) {

@Override
public boolean start(Table table) {
activeTransforms = transformsBySourceTable.get(table.getFullyQualifiedTableNameLowerCase());
if (activeTransforms != null && activeTransforms.size() > 0) {
List<TransformTable> activeTransformsTemp = transformsBySourceTable.get(table.getFullyQualifiedTableNameLowerCase());
if (activeTransformsTemp != null && activeTransformsTemp.size() > 0) {
this.sourceTable = table;
activeTransforms = new ArrayList<TransformTable>(activeTransformsTemp.size());
for (TransformTable transformation : activeTransformsTemp) {
activeTransforms.add(transformation.enhanceWithImpliedColumns(
this.sourceTable.getPrimaryKeyColumnNames(),
this.sourceTable.getColumnNames()));
}
return true;
} else {
this.sourceTable = null;
Expand Down Expand Up @@ -161,9 +167,6 @@ public void write(CsvData data) {
}

for (TransformTable transformation : transformTables) {
transformation = transformation.enhanceWithImpliedColumns(
this.sourceTable.getPrimaryKeyColumnNames(),
this.sourceTable.getColumnNames());
if (eventType == DataEventType.INSERT && transformation.isUpdateFirst()) {
eventType = DataEventType.UPDATE;
}
Expand Down

0 comments on commit 60e080d

Please sign in to comment.