You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.
Currently the default behavior is to ignore the final comma when writing a row which has a null final value, whether or not this is a valid CSV, by default we should be including the final comma. See the following unit test, adapted from @Magrath's code from #33:
@Test
public void testWrite_NullThirdColumn() throws JsonProcessingException {
final CsvSchema.Builder csvSchemaBuilder = new CsvSchema.Builder();
csvSchemaBuilder.addColumn("timestamp", CsvSchema.ColumnType.STRING);
csvSchemaBuilder.addColumn("value", CsvSchema.ColumnType.NUMBER);
csvSchemaBuilder.addColumn("id", CsvSchema.ColumnType.STRING);
final CsvSchema schema = csvSchemaBuilder.build();
final ObjectWriter writer = new CsvMapper().writer().withSchema(schema);
final String string = writer.writeValueAsString(
ImmutableMap.of("timestamp", "2014-03-10T23:32:47+00:00",
"value", 42));
assertEquals("\"2014-03-10T23:32:47+00:00\",42,\n", string);
}
The text was updated successfully, but these errors were encountered:
Currently the default behavior is to ignore the final comma when writing a row which has a null final value, whether or not this is a valid CSV, by default we should be including the final comma. See the following unit test, adapted from @Magrath's code from #33:
The text was updated successfully, but these errors were encountered: