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.
If schema is created for Float or Double class (mapper.schemaFor(Float.class) or mapper.schemaFor(Double.class)) and used to write single floating point numbers
the resultung CSV is 42.33, instead of 42.33 so an additional column separator is added at the end of the line.
For all other primitive data types, this works correctly.
Additionally, if writer is created with ObjectWriter writer = mapper.writerFor(Float.class); without explicit schema use, this works correctly (no column separator is added).
Ok. One problem with primitives, CsvSchema really is that latter is not designed for non-POJO types.
And come to think to that, I am not completely sure if and how they should be handled. Maybe they should not be serializable at all? But if they are, there would need to be some sort of pseudo-schema defined, perhaps a bogus column or something.
So: I don't know if this is a straight bug, as much as unsupported use case, at this point.
Ok, regardless, I managed to patch things to avoid interpreting primitives/wrappers as POJOs, and this makes given test pass. So while I am not 100% sure if handling works and makes sense, at least this should be an improvement.
If schema is created for Float or Double class (
mapper.schemaFor(Float.class)
ormapper.schemaFor(Double.class)
) and used to write single floating point numbersthe resultung CSV is
42.33,
instead of42.33
so an additional column separator is added at the end of the line.For all other primitive data types, this works correctly.
Additionally, if writer is created with
ObjectWriter writer = mapper.writerFor(Float.class);
without explicit schema use, this works correctly (no column separator is added).Here is a full JUnit test case for the problem:
In this test case, only the last two tests for Float and Double fail.
The text was updated successfully, but these errors were encountered: