Skip to content

Commit

Permalink
0005216: Metadata error can skip data when using
Browse files Browse the repository at this point in the history
dataloader.ignore.missing.tables parameter
  • Loading branch information
erilong committed Feb 14, 2022
1 parent 67318fe commit 19c1d7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Expand Up @@ -102,16 +102,7 @@ public boolean start(Table table) {
}
this.lastData = null;
this.sourceTable = table;
try {
this.targetTable = lookupTableAtTarget(this.sourceTable);
} catch (SqlException sqle) {
log.warn("Unable to read target table because {}", sqle.getMessage());
}
if (this.targetTable == null && this instanceof DynamicDefaultDatabaseWriter) {
if (((DynamicDefaultDatabaseWriter) this).isLoadOnly()) {
this.targetTable = table;
}
}
this.targetTable = lookupTableAtTarget(this.sourceTable);
this.sourceTable.copyColumnTypesFrom(this.targetTable);
if (this.targetTable == null && hasFilterThatHandlesMissingTable(table)) {
this.targetTable = table;
Expand Down
Expand Up @@ -1038,11 +1038,9 @@ protected Table lookupTableAtTarget(Table sourceTable) {
targetTables.put(tableNameKey, table);
}
} catch (SqlException sqle) {
log.warn("Unable to read target table because {}", sqle.getMessage());
}
if (table == null && this instanceof DynamicDefaultDatabaseWriter) {
if (((DynamicDefaultDatabaseWriter) this).isLoadOnly()) {
table = sourceTable;
// TODO: is there really a "does not exist" exception or should this be removed? copied from AbstractJdbcDdlReader.readTable()
if (sqle.getMessage() == null || !StringUtils.containsIgnoreCase(sqle.getMessage(), "does not exist")) {
throw sqle;
}
}
}
Expand Down

0 comments on commit 19c1d7e

Please sign in to comment.