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

Unable to write null values to db #7

Closed
colinl opened this issue Mar 7, 2017 · 3 comments
Closed

Unable to write null values to db #7

colinl opened this issue Mar 7, 2017 · 3 comments

Comments

@colinl
Copy link

colinl commented Mar 7, 2017

I find I am unable to push null values to the db. Sending a message {topic: some_topic, payload: null} results in the error
Error: {"error":"unable to parse 'tydwr value=null': invalid number"}
Here is a sample flow:
[
{
"id": "d1592df1.f9427",
"type": "inject",
"z": "e122f88c.3fc3c8",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 189.5,
"y": 1141,
"wires": [
[
"8d921e96.1de868"
]
]
},
{
"id": "8d921e96.1de868",
"type": "function",
"z": "e122f88c.3fc3c8",
"name": "Null payload",
"func": "msg = {topic: "bedroom/radtemp", payload: null}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 377.5,
"y": 1140,
"wires": [
[
"e18ce4c0.21f96",
"eeb056ca.f8c358"
]
]
},
{
"id": "eeb056ca.f8c358",
"type": "debug",
"z": "e122f88c.3fc3c8",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 722.5,
"y": 957,
"wires": []
},
{
"id": "e18ce4c0.21f96",
"type": "influxdb out",
"z": "e122f88c.3fc3c8",
"influxdb": "55ac6d48.e3ffbc",
"name": "",
"measurement": "tydwr",
"x": 994,
"y": 469,
"wires": []
},
{
"id": "55ac6d48.e3ffbc",
"type": "influxdb",
"z": "",
"hostname": "127.0.0.1",
"port": "8086",
"protocol": "http",
"database": "tydwr",
"name": "localhost_tydwr"
}
]

@mblackstock
Copy link
Owner

Thanks for the report. I've reproduced the issue. Unfortunately, as I understand it, influxdb 1.0 and later does not support sending a point with null values. If you want to indicate that a value is missing, one suggested technique is that you use another field to indicate missing data.

https://docs.influxdata.com/influxdb/v1.0/introduction/getting_started/ "...with InfluxDB, you can have millions of measurements, you don’t have to define schemas up-front, and null values aren’t stored."

see these links for more information.
http://glasnt.com/blog/2015/05/08/influxdb-and-nulls.html
influxdata/influxdb#2429
influxdata/docs.influxdata.com-ARCHIVE#717
influxdata/influxdb#454

This one discusses techniques for indicating missing data: https://groups.google.com/forum/#!topic/influxdb/L2_JkanwwOY

Sorry!

@colinl
Copy link
Author

colinl commented Mar 7, 2017

How very odd that they should have removed this capability. Sorry for wasting your time.
Thanks for a very useful node by the way.

@mblackstock
Copy link
Owner

No problem at all! Yes, it is odd... let me know if you see any other issues or enhancement requests.

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