-
Notifications
You must be signed in to change notification settings - Fork 292
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
What exactly is the story on nulls? #717
Comments
FWIW, the competing Axibase does support NULLs. |
@dandv those nulls are not stored in the system, they are simply filled in when the JSON is returned. There is literally no way to check the data on disk for nulls, as there just isn't anything at all stored in that event.
No, they don't. I'm not sure why you think that they do, but there are no nulls stored in the system.
Perhaps you can describe what you are trying to do, with syntax, and we can help? SELECT INTO won't remove data. |
@dandv I think the point of confusion is coming from the changes in our storage engine. In version 0.9, we used to support nullifying a result by writing to a different field. For example, if I inserted the point
but then later decided that I wanted to redact the fields
If I then queried for this data, I would get the following.
The reason why this worked was that data used to be store in rows, so reinserting a point in a row without specifying the other fields would nullify values. When we changed our storage engine, we stopped storing rows and started storing columns. This meant that the tactic highlighted above no longer works. And querying for that data would result in all of the values written being stored.
As @beckettsean notes, the database does not store null values. By simply looking at the values that are returned when querying, it does indeed look like nulls are stored.
However no null values are actually stored. All fields in InfluxDB must have some value. The reason why we report null, is because no value was found. |
That makes sense; thanks for the explanations. That's why I believed there were actual nulls stored. Anyway, from a user's perspective, this is less relevant than how to check for nulls. I've described an example use case in #718. There's an irregular time series and I'm trying to remove points where a field has a bogus value with I would want to I'm still new to InfluxDB and I might be getting nulls wrong. Some guidance in the documentation regarding nulls would be appreciated. |
A point has one to many fields. Any point in a series may have one or more of the fields defined on that series. If a point does not have a value for a particular field, it simply doesn't have that field. It's not that there is a null for that field, it's that the field and its value don't exist on that point.
That statement can only return points where the field key I don't know that there is a way to search for points that don't have a field. |
How can undesired field values be filtered out of a measurement then? (I've also asked the question at influxdata/influxdb#3210 (comment).) Worse, I've found that even |
Whenever doing Just running
By undesired field values, do you mean they have some value, but not the correct value and you'd like to delete them? Like in the following example:
And I decided that I don't want to keep and of the values above 100? If so then
Followed by
Should give me what I want
|
That being said the |
This PR suggests that you shouldn't be able to insert nulls in the database. https://www.influxdata.com/get-started/influxdb-command-line-basics/ also says "null values aren't stored". Bloggers have picked up on this, after questions on SO have remained unanswered.
However, it's very easy to insert nulls by omitting fields in HTTP requests,
or when importing data:
Both insert nulls in InfluxDB 1.0.0.
https://docs.influxdata.com/influxdb/v1.0/tools/api/ also shows plenty of null values.
A sane feature request, Add boolean operator to check for null values (and its inverse, i.e. not null) was closed without explanation.
Given that
DELETE FROM WHERE field=...
doesn't work, the inability to handle nulls makes it super cumbersome to SELECT INTO in order to strip bad points from a series, if your points contain nulls.The text was updated successfully, but these errors were encountered: