New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null value set for missing fields #116
Comments
Can you please provide some sample code that reproduces this issue you're having? |
//TSV parser settings defined //Model class for CSV My CSV has feilds: So here is my scenario: Let me know if you need anything more from me. Thanks for the prompt reply!!! 👍 |
Thank you. The parser behaves like this by design": if nothing is parsed then you will get Having said that, you can set a value for
Hope this helps. |
Thanks Alot. |
Hey. I tried using the default null value parameter, however that too didnt seem to do the job. |
To be fixed with version 2.2.2 (planned to be released on Monday) |
…notated attributes. - Better handling of primitive values by assigning a default primitive value instead of null (which would throw a NPE) when nothing is parsed for the field.
Fixed. Version 2.2.2 was just released and includes this adjustment. |
Thanks. |
Hey the issue still exists in Univocity where if the column doesn't exist, the attribute in the POJO is still set to null - defaultNullRead="" doesn't seem to be working, and so if nothing is parsed, the value is left as a null value. Has this been corrected? Sorry to bring up an old issue but I'm still facing this issue that raphkr was facing in Univocity-Parsers 2.4.1. |
@binhvinhmai the unit test I originally created for this issue doesn't reveal any issues. Do you mind sharing the code you are using (or some simplified version of it) that reproduces the issue you are having? |
I have fields in my code which are missing from the CSV i am trying to parse. In my parser settings I have set the default null value to be an empty string. However for the missing fields, the value being set is null.
I would like to know if this is the desired behaviour or am i doing something wrong??
The text was updated successfully, but these errors were encountered: