-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[0.9.6] Query with where filter by field value and tag output incorrect results #5152
Comments
jackzampolin
changed the title
Query with where filter by field value and tag output incorrect results
[0.9.6] Query with where filter by field value and tag output incorrect results
Dec 18, 2015
Reproduced:
|
Possibly related to #4917, although not an exact duplicate, since the |
jsternberg
added a commit
that referenced
this issue
Mar 15, 2016
If an OR was used, merging filters between different expressions would not work correctly. If one of the sides had a set of series ids with a condition and the other side had no series ids associated with the expression, all of the series from the side with a condition would have the condition ignored. Instead of defaulting a non-existant series filter to true, it should just be false and the evaluation of the one side that does exist should take care of determining if the series id should be included or not. The AND condition used false correctly so did not have to be changed. If a tag did not exist and `!=` or `!~` were used, it would return false even though the neither a field or a tag equaled those values. This has now been modified to correctly return the correct series ids and the correct condition. Also fixed a panic that would occur when a tag caused a field access to become unnecessary. The filter using the field access still got created and used even though it was unnecessary, resulting in an attempted access to a non-initialized map. Fixes #5152 and a bunch of other miscellaneous issues.
jsternberg
added a commit
that referenced
this issue
Mar 15, 2016
If an OR was used, merging filters between different expressions would not work correctly. If one of the sides had a set of series ids with a condition and the other side had no series ids associated with the expression, all of the series from the side with a condition would have the condition ignored. Instead of defaulting a non-existant series filter to true, it should just be false and the evaluation of the one side that does exist should take care of determining if the series id should be included or not. The AND condition used false correctly so did not have to be changed. If a tag did not exist and `!=` or `!~` were used, it would return false even though the neither a field or a tag equaled those values. This has now been modified to correctly return the correct series ids and the correct condition. Also fixed a panic that would occur when a tag caused a field access to become unnecessary. The filter using the field access still got created and used even though it was unnecessary, resulting in an attempted access to a non-initialized map. Fixes #5152 and a bunch of other miscellaneous issues.
jsternberg
added a commit
that referenced
this issue
Mar 22, 2016
If an OR was used, merging filters between different expressions would not work correctly. If one of the sides had a set of series ids with a condition and the other side had no series ids associated with the expression, all of the series from the side with a condition would have the condition ignored. Instead of defaulting a non-existant series filter to true, it should just be false and the evaluation of the one side that does exist should take care of determining if the series id should be included or not. The AND condition used false correctly so did not have to be changed. If a tag did not exist and `!=` or `!~` were used, it would return false even though the neither a field or a tag equaled those values. This has now been modified to correctly return the correct series ids and the correct condition. Also fixed a panic that would occur when a tag caused a field access to become unnecessary. The filter using the field access still got created and used even though it was unnecessary, resulting in an attempted access to a non-initialized map. Fixes #5152 and a bunch of other miscellaneous issues.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple example, I push these values to measurement (two fields, one tag with two values):
bugtest,varname=a vala=1000
bugtest,varname=a vala=2000
bugtest,varname=a vala=200000
bugtest,varname=b valb=500
bugtest,varname=b valb=600
bugtest,varname=b valb=700
Now, these queries runs OK:
select * from bugtest where varname <> 'a' (results only 3 rows with varname=b)
select * from bugtest where vala < 10000 (results only 2 rows with varname=a)
Now I want to combine it to get all varname=b and varname=a where vala < 10000:
select * from bugtest where vala < 10000 or varname <> 'a'
I believe that this should work (returns 5 rows) but i gets me all 6 rows in measurement. I believe that this is bug because I think, that row varname=a vala=200000 shouldn't pass this condition. Tested on v0.9.6.
The text was updated successfully, but these errors were encountered: