Skip to content

Commit a3bdecf

Browse files
committed
Set error details provider before setting input/ouput commiters
1 parent bac603f commit a3bdecf

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

database-commons/src/main/java/io/cdap/plugin/db/sink/AbstractDBSink.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,9 @@ public void prepareRun(BatchSinkContext context) {
239239
configuration.set(ETLDBOutputFormat.COMMIT_BATCH_SIZE,
240240
context.getArguments().get(ETLDBOutputFormat.COMMIT_BATCH_SIZE));
241241
}
242-
243-
addOutputContext(context);
244-
245242
// set error details provider
246243
context.setErrorDetailsProvider(new ErrorDetailsProviderSpec(getErrorDetailsProviderClassName()));
244+
addOutputContext(context);
247245
}
248246
protected void addOutputContext(BatchSinkContext context) {
249247
context.addOutput(Output.of(dbSinkConfig.getReferenceName(),

database-commons/src/main/java/io/cdap/plugin/db/source/AbstractDBSource.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,10 @@ public void prepareRun(BatchSourceContext context) throws Exception {
288288
lineageRecorder.recordRead("Read", "Read from database plugin",
289289
schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList()));
290290
}
291-
context.setInput(Input.of(sourceConfig.getReferenceName(), new SourceInputFormatProvider(
292-
DataDrivenETLDBInputFormat.class, connectionConfigAccessor.getConfiguration())));
293-
294291
// set error details provider
295292
context.setErrorDetailsProvider(new ErrorDetailsProviderSpec(getErrorDetailsProviderClassName()));
293+
context.setInput(Input.of(sourceConfig.getReferenceName(), new SourceInputFormatProvider(
294+
DataDrivenETLDBInputFormat.class, connectionConfigAccessor.getConfiguration())));
296295
}
297296

298297
/**

0 commit comments

Comments
 (0)