Akumuli icon indicating copy to clipboard operation
Akumuli copied to clipboard

Support for NULL (or NaN) in data model?

Open forceoffire opened this issue 8 years ago • 2 comments

Dear Eugene,

I am curious whether it is possible to store NaN values (which I will use to represent 'NULL') in the db as a floating-point entry? This is crucial because I am storing data from a measuring device that sometimes come back with faulty data. The fact that the data is faulty is meaningful, so I don't want to "skip over" those timestamps where the reported data is "bad", I would like to be able to store it as "NaN" so that I can later track how often it occurred.

If it isn't possible to do this as yet, I might be able to go and make the changes myself, but I just want to be sure I'm not missing something obvious first!

Sincere regards, Forceoffire

forceoffire avatar Oct 10 '17 08:10 forceoffire

I believe it should be possible to send 'nan' instead of floating point value and the database will be able to parse it and write to the underlying storage and also read it back. I'm using strtod function from C stdlib to parse floats and it can parse NaN values. Also, the database code is NaN-neutral and FP-compression algorithm works with NaN values. But, I don't have a unit-test that covers this use case, this is something that I can improve.

Lazin avatar Oct 10 '17 08:10 Lazin

Thank you very much for such a quick answer! I will test it, and hopefully it works.

forceoffire avatar Oct 10 '17 08:10 forceoffire