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

query results cannot span epoch 0 #2703

Closed
beckettsean opened this issue May 29, 2015 · 2 comments
Closed

query results cannot span epoch 0 #2703

beckettsean opened this issue May 29, 2015 · 2 comments

Comments

@beckettsean
Copy link
Contributor

Here are my points:

{"database":"mydb",
"retentionPolicy":"default",
"points":[
    {"name":"old",
     "time": -1422,
     "precision": "s",
         "fields":{"value":10000000}},
    {"name":"old",
     "time": 1422568543,
     "precision": "ms",
     "fields":{"value":10000}},
    {"name":"old",
     "time": 1422568543,
     "precision": "s",
         "fields":{"value":100}},
    {"name":"old",
     "fields":{"value":1}}]
}

One point is written to a time before epoch 0, one is written a few weeks after epoch 0, one is earlier this year, and the final one inherits now() when inserted.

I cannot craft a WHERE time clause that will return all points:

> select * from old
name: old
---------
time                value
1970-01-17T11:09:28.543Z    10000
2015-01-29T21:55:43Z        100
2015-05-29T23:23:01.796811813Z  1

> select * from old where time > -10000s
name: old
---------
time            value
1969-12-31T23:36:18Z    1e+07

> select * from old where time < now()
name: old
---------
time                value
1970-01-17T11:09:28.543Z    10000
2015-01-29T21:55:43Z        100
2015-05-29T23:23:01.796811813Z  1

> select * from old where time > -10000s and time < now()
name: old
---------
time            value
1969-12-31T23:36:18Z    1e+07
@beckettsean
Copy link
Contributor Author

Same appears to hold for aggregate queries, as well:

> select count(value) from old 
name: old
---------
time            count
1970-01-01T00:00:00Z    3

> select count(value) from old where time > -10000s 
name: old
---------
time            count
1970-01-01T00:00:00Z    1

> select count(value) from old where time < now()
name: old
---------
time            count
1970-01-01T00:00:00Z    3

> select count(value) from old where time > -10000s and time < now()
name: old
---------
time            count
1970-01-01T00:00:00Z    1

> select count(value) from old where time < now() and time > -10000s
name: old
---------
time            count
1970-01-01T00:00:00Z    1

@jwilder
Copy link
Contributor

jwilder commented Aug 26, 2016

Fixed via #7212.

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

2 participants