Skip to content

Commit 5cf2d8c

Browse files
committed
improve handling of null and empty strings
1 parent 0b63053 commit 5cf2d8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/de/rwth/idsg/steve/repository/impl/DataImportExportRepositoryImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class DataImportExportRepositoryImpl implements DataImportExportRepositor
5959

6060
private final DSLContext ctx;
6161

62-
private final CSVFormat csvFormatWithHeader = new CSVFormat();
62+
private final CSVFormat csvFormatWithHeader = new CSVFormat().nullString("");
6363
private final CSVFormat csvFormatNoHeader = csvFormatWithHeader.header(false);
6464
private final Converter<String, Timestamp> isoTimestampConverter = new IsoTimestampConverter();
6565

@@ -120,6 +120,7 @@ public void importCsv(InputStream in, Table<?> table) throws IOException {
120120
.batchAfter(BATCH_SIZE) // Put up to X statements (bulk or not) in a single statement batch.
121121
.loadCSV(in, StandardCharsets.UTF_8)
122122
.fields(getTableFields(table))
123+
.nullString("")
123124
.execute();
124125

125126
if (!CollectionUtils.isEmpty(loader.errors())) {

0 commit comments

Comments
 (0)