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

[0.9.5] multiple OR tag clauses return the results from only one clause #4917

Closed
Advoskr opened this issue Nov 26, 2015 · 6 comments
Closed

Comments

@Advoskr
Copy link

Advoskr commented Nov 26, 2015

Hi!

I've been tested some Influx quieries and found that OR operator works incorrectly when applied many times to one field.

First of all, i have a series with some points
image

And perform Select for it with AND operator to select specific time range:
Select * from MeasurementEvent where SensorAlias='S1' and (time>3 and time<6)
image

Works well! But when i want to find points, which are out if this range i get very strange result:
Select * from MeasurementEvent where SensorAlias='S1' and (time<3 OR time>6)
image

Also, this bug(is it?) affects quieries like this:
Select * from MeasurementEvent where SensorAlias='S1' and (time=3 or time=4)
image

And the last one is really critical to me, since Influx now doesn't support nor join, neither merge.

@beckettsean
Copy link
Contributor

This is quite possibly related to #3290.

@beckettsean
Copy link
Contributor

@rkuchan can you repro with 0.9.5?

@rkuchan
Copy link
Contributor

rkuchan commented Dec 2, 2015

I'm able to repro with 0.9.5.1:

> SELECT water_level FROM h2o_feet WHERE location='santa_monica' AND time = '2015-08-18T00:06:00Z'
name: h2o_feet
--------------
time            water_level
2015-08-18T00:06:00Z    2.116

> SELECT water_level FROM h2o_feet WHERE location='santa_monica' AND time = '2015-08-18T00:12:00Z'
name: h2o_feet
--------------
time            water_level
2015-08-18T00:12:00Z    2.028

> {er_level FROM h2o_feet WHERE location='santa_monica' AND (time = '2015-08-18T00:06:00Z' OR time = '2015-08-18T00:12:00Z')
name: h2o_feet
--------------
time            water_level
2015-08-18T00:12:00Z    2.028

@beckettsean beckettsean changed the title [0.9.5] OR Incorrect behavior [0.9.5] multiple OR tag clauses return the results from only one clause Dec 2, 2015
@beckettsean
Copy link
Contributor

@benbjohnson another one for the rework of the query engine

@martianoff
Copy link

"OR" within time query doesnt work:

SELECT MEAN(price) as avg_price FROM symbol_history where symbol_id = '142' and ((time > 1451053800s and time < 1451077200s)) group by time(1d)

Returns:

{"results":[{"series":[{"name":"symbol_history","columns":["time","avg_price"],"values":[["2015-12-25T14
:30:00.000000001Z",202.22999999998783]]}]}]}

SELECT MEAN(price) as avg_price FROM symbol_history where symbol_id = '142' and ((time > 1451053800s and time < 1451077200s) or (time > 1451313000s and time < 1451336400s)) group by time(1d)

Returns:

{"results":[{}]}

Expected more results than in the first query

@jsternberg
Copy link
Contributor

Closing this since it seems to be a duplicate of #3290. #5152 represents a bug with dealing with tags (which this issue seems to allude to, but doesn't give a working example). I'm going to leave #5152 open since it has a reproducer I can use.

In summary, there are two issues. One is with multiple time intervals and the other is when you mix tag and field conditions using OR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants