Source:
public void init(File dataFile, @Nullable Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig) throws IOException { _dataFile = dataFile; CSVRecordReaderConfig config = (CSVRecordReaderConfig) recordReaderConfig; char multiValueDelimiter; if (config == null) { _format = CSVFormat.DEFAULT.withDelimiter(CSVRecordReaderConfig.DEFAULT_DELIMITER).withHeader(); multiValueDelimiter = CSVRecordReaderConfig.DEFAULT_MULTI_VALUE_DELIMITER; } else { CSVFormat format; String formatString = config.getFileFormat(); if (formatString == null) { format = CSVFormat.DEFAULT; } else { switch (formatString.toUpperCase()) { case "EXCEL": format = CSVFormat.EXCEL; break; case "MYSQL": format = CSVFormat.MYSQL; break; case "RFC4180": format = CSVFormat.RFC4180; break; case "TDF": format = CSVFormat.TDF; break; default: format = CSVFormat.DEFAULT; break; } } char delimiter = config.getDelimiter(); format = format.withDelimiter(delimiter); String csvHeader = config.getHeader(); if (csvHeader == null) { format = format.withHeader(); } else { format = format.withHeader(StringUtils.split(csvHeader, delimiter)); } Character commentMarker = config.getCommentMarker(); format = format.withCommentMarker(commentMarker); _format = format; multiValueDelimiter = config.getMultiValueDelimiter(); } _recordExtractor = new CSVRecordExtractor(); CSVRecordExtractorConfig recordExtractorConfig = new CSVRecordExtractorConfig(); recordExtractorConfig.setMultiValueDelimiter(multiValueDelimiter); init(); if (fieldsToRead == null || fieldsToRead.isEmpty()) { fieldsToRead = _parser.getHeaderMap().keySet(); } _recordExtractor.init(fieldsToRead, recordExtractorConfig); }

Target:
public void init(File dataFile, @Nullable Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig) throws IOException { _dataFile = dataFile; CSVRecordReaderConfig config = (CSVRecordReaderConfig) recordReaderConfig; char multiValueDelimiter; if (config == null) { _format = CSVFormat.DEFAULT.withDelimiter(CSVRecordReaderConfig.DEFAULT_DELIMITER).withHeader(); multiValueDelimiter = CSVRecordReaderConfig.DEFAULT_MULTI_VALUE_DELIMITER; } else { CSVFormat format; String formatString = config.getFileFormat(); if (formatString == null) { format = CSVFormat.DEFAULT; } else { switch (formatString.toUpperCase()) { case "EXCEL": format = CSVFormat.EXCEL; break; case "MYSQL": format = CSVFormat.MYSQL; break; case "RFC4180": format = CSVFormat.RFC4180; break; case "TDF": format = CSVFormat.TDF; break; default: format = CSVFormat.DEFAULT; break; } } char delimiter = config.getDelimiter(); format = format.withDelimiter(delimiter); String csvHeader = config.getHeader(); if (csvHeader == null) { format = format.withHeader(); } else { format = format.withHeader(StringUtils.split(csvHeader, delimiter)); } Character commentMarker = config.getCommentMarker(); format = format.withCommentMarker(commentMarker); _format = format; multiValueDelimiter = config.getMultiValueDelimiter(); } _recordExtractor = new CSVRecordExtractor(); init(); CSVRecordExtractorConfig recordExtractorConfig = new CSVRecordExtractorConfig(); recordExtractorConfig.setMultiValueDelimiter(multiValueDelimiter); recordExtractorConfig.setColumnNames(_parser.getHeaderMap().keySet()); _recordExtractor.init(fieldsToRead, recordExtractorConfig); }