Skip to content

Commit

Permalink
Bugfix for case-mismatch at LaodFilter handling for schema/catalog
Browse files Browse the repository at this point in the history
parts.
  • Loading branch information
NiasSt90 committed Sep 9, 2015
1 parent 9b231c3 commit e77d506
Showing 1 changed file with 12 additions and 15 deletions.
Expand Up @@ -125,28 +125,21 @@ protected boolean processLoadFilters(DataContext context, Table table, CsvData d
foundFilters = lookupFilters(foundFilters,
table.getCatalog(), FormatUtils.WILDCARD, FormatUtils.WILDCARD);

foundFilters = lookupFilters(foundFilters,
foundFilters = lookupFilters(foundFilters,
FormatUtils.WILDCARD, FormatUtils.WILDCARD, FormatUtils.WILDCARD);
}

String tableName = null;
if (isIgnoreCase()) {
tableName = table.getName().toUpperCase();
} else {
tableName = table.getName();
}
foundFilters = lookupFilters(foundFilters,
FormatUtils.WILDCARD, FormatUtils.WILDCARD, table.getName());

foundFilters = lookupFilters(foundFilters,
FormatUtils.WILDCARD, FormatUtils.WILDCARD, tableName);

foundFilters = lookupFilters(foundFilters,
FormatUtils.WILDCARD, table.getSchema(), tableName);
FormatUtils.WILDCARD, table.getSchema(), table.getName());

foundFilters = lookupFilters(foundFilters,
table.getCatalog(), FormatUtils.WILDCARD, tableName);
table.getCatalog(), FormatUtils.WILDCARD, table.getName());

foundFilters = lookupFilters(foundFilters,
table.getCatalog(), table.getSchema(), tableName);
table.getCatalog(), table.getSchema(), table.getName());

if (foundFilters != null) {
for (LoadFilter filter : foundFilters) {
Expand All @@ -161,8 +154,12 @@ protected boolean processLoadFilters(DataContext context, Table table, CsvData d
}

private List<LoadFilter> lookupFilters(List<LoadFilter> foundFilters, String catalogName, String schemaName, String tableName) {
List<LoadFilter> filters = loadFilters.get(Table.getFullyQualifiedTableName(catalogName,
schemaName, tableName));
String fullyQualifiedTableName = Table.getFullyQualifiedTableName(catalogName, schemaName, tableName);
if (isIgnoreCase()) {
fullyQualifiedTableName = fullyQualifiedTableName.toUpperCase();
}
List<LoadFilter> filters = loadFilters.get(
fullyQualifiedTableName);
if (filters != null) {
if (foundFilters == null) {
foundFilters = new ArrayList<LoadFilter>();
Expand Down

0 comments on commit e77d506

Please sign in to comment.