Skip to content

Commit

Permalink
Log more error information
Browse files Browse the repository at this point in the history
  • Loading branch information
tuliren committed Jan 5, 2022
1 parent b2fd2bb commit 32aa7bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@ protected void tearDown(final TestDestinationEnv testEnv) throws SQLException {
.deleteObjects(new DeleteObjectsRequest(s3Config.getBucketName()).withKeys(keysToDelete));
LOGGER.info("Deleted {} file(s).", result.getDeletedObjects().size());
}
s3Client.shutdown();

// clean up database
LOGGER.info("Dropping database schema {}", databricksConfig.getDatabaseSchema());
final Database database = getDatabase(databricksConfig);
// we cannot use jooq dropSchemaIfExists method here because there is no proper dialect for
// Databricks, and it incorrectly quotes the schema name
database.query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE;", databricksConfig.getDatabaseSchema())));
try (final Database database = getDatabase(databricksConfig)) {
// we cannot use jooq dropSchemaIfExists method here because there is no proper dialect for
// Databricks, and it incorrectly quotes the schema name
database.query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE;", databricksConfig.getDatabaseSchema())));
} catch (final Exception e) {
throw new SQLException(e);
}
}

private static Database getDatabase(final DatabricksDestinationConfig databricksConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public StandardCheckConnectionOutput run(final StandardCheckConnectionInput inpu
LOGGER.debug("Check connection job received output: {}", output);
return output;
} else {
throw new WorkerException("Error while getting checking connection.");
throw new WorkerException(String.format("Error checking connection, status: %s, exit code: %d", status, exitCode));
}

} catch (final Exception e) {
Expand Down

0 comments on commit 32aa7bb

Please sign in to comment.