influxdb-java
influxdb-java copied to clipboard
null/empty values mapped to 0 for a double ?
null/empty values mapped to 0 for a double ? They should be set to Double.NaN isn't it ? Or am i missing something here ? Thanks for your help in advance.
can you please define more detailed what problem you are facing.
I have same issue with a String attribute. I try to generate a Point with info from API, but if field is null, I get a partial write error when trying to write the point to Influx. Is there a way to set a default value? Without manually using a setter, of course. Thanks.
@stoxalpha @fdbatista could you please add here:
- a test case or a piece of code that is failing;
- what you expected to happen;
- what happened.
@stoxalpha @fdbatista could you please add here:
- a test case or a piece of code that is failing;
- what you expected to happen;
- what happened.
Ok, here is my case:
I consume a remote API endpoint and convert this data into an InfluxDB Point via a custom POJO.
The API response sometimes comes with some null values, something like:
{ id: 1, title: "White Fang", author: "", isbn: "00234212" }
In this case, when I use the Point.measurementByPOJO function, the author field becomes null instead of empty string, so when trying to persist this point, InfluxDB engine says that it cannot parse this object, because the point gets generated like title="White Fang",author=,isbn="00234212".
So, right now I am dealing with this situation at the POJO level because this issue is happening only with the author field, but it would be nice to have some annotation to handle this, something like @Default("None") or so.
Is it clear enough?
Thanks for your feedback.