Skip to content

Commit 0843ac1

Browse files
aebadiradMarkLogic Builder
authored andcommitted
DHFPROD-2592: Remove duplicate code but keep check for command line
1 parent 24f6af4 commit 0843ac1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

marklogic-data-hub/src/main/java/com/marklogic/hub/step/impl/WriteStepRunner.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ public RunStepResponse run() {
282282
inputFilePath = (String)fileLocation.get("inputFilePath");
283283
inputFileType = (String)fileLocation.get("inputFileType");
284284
outputURIReplacement = (String)fileLocation.get("outputURIReplacement");
285+
if(inputFileType.equalsIgnoreCase("csv") && fileLocation.get("separator") != null) {
286+
this.separator =((String) fileLocation.get("separator")).trim();
287+
}
285288

286289
if(stepConfig.get("batchSize") != null){
287290
this.batchSize = Integer.parseInt(stepConfig.get("batchSize").toString());
@@ -305,11 +308,13 @@ public RunStepResponse run() {
305308
throw new IllegalArgumentException("Invalid argument for file type " + inputFileType + ". When specifying a separator, the file type must be 'csv'");
306309
}
307310
this.separator = ((String) fileLocation.get("separator")).trim();
308-
if (separator.equalsIgnoreCase("\\t")) {
309-
separator = "\t";
310-
}
311311
}
312312
}
313+
314+
if (separator != null && separator.equalsIgnoreCase("\\t")) {
315+
this.separator = "\t";
316+
}
317+
313318
if(stepConfig.get("stopOnFailure") != null){
314319
this.withStopOnFailure(Boolean.parseBoolean(stepConfig.get("stopOnFailure").toString()));
315320
}

0 commit comments

Comments
 (0)