Skip to content
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

Cannot write nulls to the database #159

Closed
retorquere opened this issue Aug 21, 2016 · 5 comments
Closed

Cannot write nulls to the database #159

retorquere opened this issue Aug 21, 2016 · 5 comments

Comments

@retorquere
Copy link
Contributor

If I try to pass a point like this to write_points, I get an error (the payload generator generates GPS.city=)

{ timestamp: point['time'], series: 'car', tags: { license: tags['license'] }, values: { 'GPS.city' => nil } }
@dmke
Copy link
Contributor

dmke commented Aug 21, 2016

Currently, that's intended: you simply cannot store null values. (I've stumbled upon this myself, see influxdata/influxdb#6150).

For the moment, I recommend using something .select{|_,v| !v.nil? } (or .compact if ActiveSupport is available) on the hash you pass to write_point/write_points.

If you really need this in several places and projects, we could discuss an omit_nil_values option for InfluxDB::Client.

@retorquere
Copy link
Contributor Author

retorquere commented Aug 22, 2016 via email

@dmke
Copy link
Contributor

dmke commented Aug 22, 2016

I see.

Maybe it's easier to store raw and analyzed data in different measurements (that is what I do)?

@retorquere
Copy link
Contributor Author

I have that (of sorts), but it would still require recalculation of the whole (quite large) derived measurement when the algorithm changes for any one of the fields. But if InfluxDB doesn't allow for it, there's nothing much the ruby interface can do.

@dmke
Copy link
Contributor

dmke commented Aug 22, 2016

Indeed. Maybe influxdata/influxdb#6150 is too broad and you should to file a different issue.

@dmke dmke closed this as completed Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants