Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@ class CobolProcessorInPlace(readerParameters: ReaderParameters,
(rawRecordProcessor: RawRecordProcessor): Long = {
val recordExtractor = CobolProcessorBase.getRecordExtractor(readerParameters, copybookContents, inputStream, None)

val dataStream = inputStream.copyStream()
try {
StreamProcessor.processStreamInPlace(copybook,
options,
dataStream,
inputStream,
recordExtractor,
rawRecordProcessor,
outputStream)
} finally {
dataStream.close()
inputStream.close()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ object SparkCobolProcessor {
private def getCobolParameters(listOfFiles: Seq[String], copybookContents: String, options: Map[String, String], ignoreRedundantOptions: Boolean): CobolParameters = {
val varLenOptions = options + (PARAM_GENERATE_RECORD_ID -> "true")

// This method might be called several times during the ebcdic file processing. If there are redundant options, they will be logged.
// `ignoreRedundantOptions=true` when the method is called just for copybook parsing so logging redundant options could be skipped.
CobolParametersParser.parse(new Parameters(varLenOptions), !ignoreRedundantOptions)
.copy(sourcePaths = listOfFiles, copybookContent = Option(copybookContents))
}
Expand Down
Loading