Skip to content

Commit

Permalink
Merge pull request data-integrations#540 from cloudsufi/patch/plugin-…
Browse files Browse the repository at this point in the history
…1845

[PLUGIN-1845] Return null for ErrorDetailsProvider by default
  • Loading branch information
psainics authored Jan 23, 2025
2 parents e0ea94f + 6de940c commit 93694c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void validateOperations(FailureCollector collector, T dbSinkConfig, @Null
* @return ErrorDetailsProvider class name
*/
protected String getErrorDetailsProviderClassName() {
return DBErrorDetailsProvider.class.getName();
return null;
}

/**
Expand Down Expand Up @@ -254,7 +254,9 @@ public void prepareRun(BatchSinkContext context) {
context.getArguments().get(ETLDBOutputFormat.COMMIT_BATCH_SIZE));
}
// set error details provider
context.setErrorDetailsProvider(new ErrorDetailsProviderSpec(getErrorDetailsProviderClassName()));
if (!Strings.isNullOrEmpty(getErrorDetailsProviderClassName())) {
context.setErrorDetailsProvider(new ErrorDetailsProviderSpec(getErrorDetailsProviderClassName()));
}
addOutputContext(context);
}
protected void addOutputContext(BatchSinkContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ protected SchemaReader getSchemaReader() {
* @return ErrorDetailsProvider class name
*/
protected String getErrorDetailsProviderClassName() {
return DBErrorDetailsProvider.class.getName();
return null;
}

private DriverCleanup loadPluginClassAndGetDriver(Class<? extends Driver> driverClass)
Expand Down Expand Up @@ -299,7 +299,9 @@ public void prepareRun(BatchSourceContext context) throws Exception {
schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList()));
}
// set error details provider
context.setErrorDetailsProvider(new ErrorDetailsProviderSpec(getErrorDetailsProviderClassName()));
if (!Strings.isNullOrEmpty(getErrorDetailsProviderClassName())) {
context.setErrorDetailsProvider(new ErrorDetailsProviderSpec(getErrorDetailsProviderClassName()));
}
context.setInput(Input.of(sourceConfig.getReferenceName(), new SourceInputFormatProvider(
DataDrivenETLDBInputFormat.class, connectionConfigAccessor.getConfiguration())));
}
Expand Down

0 comments on commit 93694c4

Please sign in to comment.