Skip to content

Commit

Permalink
0001318: Bind column names using original case and UPPER case for loa…
Browse files Browse the repository at this point in the history
…d filters.

Bind original case and UPPER case for transform filters.
  • Loading branch information
abrougher committed Jul 10, 2013
1 parent feb9676 commit b2c314a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -142,12 +142,14 @@ protected void bind(Interpreter interpreter, DataContext context, Table table, C
Map<String, String> sourceValues = data.toColumnNameValuePairs(table.getColumnNames(),
CsvData.ROW_DATA);
for (String columnName : sourceValues.keySet()) {
interpreter.set(columnName, sourceValues.get(columnName));
interpreter.set(columnName.toUpperCase(), sourceValues.get(columnName));
}

Map<String, String> oldValues = data.toColumnNameValuePairs(table.getColumnNames(),
CsvData.OLD_DATA);
for (String columnName : oldValues.keySet()) {
interpreter.set(OLD_ + columnName, sourceValues.get(columnName));
interpreter.set(OLD_ + columnName.toUpperCase(), sourceValues.get(columnName));
}
}
Expand Down
Expand Up @@ -70,16 +70,17 @@ public String transform(IDatabasePlatform platform,
interpreter.set("sourceDmlType", data.getSourceDmlType());
interpreter.set("sourceDmlTypeString", data.getSourceDmlType().toString());
interpreter.set("context", context);

for (String columnName : sourceValues.keySet()) {
interpreter.set(columnName.toUpperCase(), sourceValues.get(columnName));
interpreter.set(columnName, sourceValues.get(columnName));
}

Set<String> keys = context.keySet();
for (String key : keys) {
interpreter.set(key, context.get(key));
}
}

Object result = interpreter.eval(column.getTransformExpression());
if (result != null) {
return result.toString();
Expand Down

0 comments on commit b2c314a

Please sign in to comment.