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

can't query for points before epoch 0 #7194

Closed
beckettsean opened this issue Aug 23, 2016 · 8 comments
Closed

can't query for points before epoch 0 #7194

beckettsean opened this issue Aug 23, 2016 · 8 comments
Assignees
Milestone

Comments

@beckettsean
Copy link
Contributor

Bug report

System info: [Include InfluxDB version, operating system name, and other relevant details]
Ubuntu 14.01, InfluxDB 0.13 from package

Steps to reproduce:

Add some data, including data before epoch 0

Connected to http://localhost:8086 version 0.13.0
InfluxDB shell version: 0.13.0
> use mydb
Using database mydb
> insert e0 value=1 -100
> insert e0 value=2 100
> insert e0 value=3

As expected, epoch 0 is the lower bound if none is provided:

> select * from e0
name: e0
--------
time            value
100         2
1471979518382460726 3

> 

However, the lower bound cannot be changed to anything less than epoch 0:

> select * from e0 where time > '1968-01-01'
ERR: time 1968-01-01T00:00:00Z underflows time literal
> select * from e0 where time > '1968-01-01T00:00:00Z'
ERR: time 1968-01-01T00:00:00Z underflows time literal
> select * from e0 where time > '1970-01-01T00:00:00Z'
name: e0
--------
time    value
100 2

> select * from e0 where time > '1969-01-01T00:00:00Z'
ERR: time 1969-01-01T00:00:00Z underflows time literal
> select * from e0 where time > '1969-12-31T23:59:59Z'
ERR: time 1969-12-31T23:59:59Z underflows time literal
> select * from e0 where time > now() - 4000w
ERR: time 1939-12-26T19:12:10Z underflows time literal

Expected behavior: [What you expected to happen]

If negative timestamps are valid for writes, they need to be valid for reads.

@jwilder
Copy link
Contributor

jwilder commented Aug 24, 2016

This is using 0.9.6.1. It didn't work either.

> insert e0 value=1 -100
> insert e0 value=2 100
> insert e0 value=3
> select * from e0
name: e0
--------
time                value
1970-01-01T00:00:00.0000001Z    2
2016-08-24T23:28:02.453424926Z  3

> select * from e0 where time > '1968-01-01'
> select * from e0 where time > '1968-01-01T00:00:00Z'
> select * from e0 where time > '1970-01-01T00:00:00Z'
name: e0
--------
time                value
1970-01-01T00:00:00.0000001Z    2
2016-08-24T23:28:02.453424926Z  3

> select * from e0 where time > '1969-01-01T00:00:00Z'
> select * from e0 where time > '1969-12-31T23:59:59Z'
> select * from e0 where time > now() - 4000w

@jsternberg
Copy link
Contributor

So this isn't a regression then? I think we've almost got it implemented, but then it would be a new feature and not a regression.

@beckettsean
Copy link
Contributor Author

Worked in 0.9.1: #2703

Seems to have been part of the 0.9 feature set: #4500.

Not sure why it stopped working with 0.9.6, but clearly we need to decide and document once and for all if we do or do not support pre-epoch 0 timestamps.

@pauldix @toddboom

@pauldix
Copy link
Member

pauldix commented Aug 25, 2016

I think we should support them unless there's a compelling reason not to. Financial cases bringing in historical market data might want to have data pre 1970.

@jwilder
Copy link
Contributor

jwilder commented Aug 25, 2016

I agree w/ @pauldix. Not supporting them would exclude many use cases that use historical data.

@jsternberg
Copy link
Contributor

Fixed via #7212.

@drasko
Copy link

drasko commented Apr 23, 2017

Is this fixed? I've just installed 1.2.2 on Debian, and I am getting:

2017/04/23 17:27:53 time 0001-01-01T00:00:00Z underflows time literal

@theodiefenthal
Copy link
Contributor

@drasko Dates prior to 1.1.1970 do work but not up to 0001. It's more like 1950 is working...

I don't see a document which points out, which now is the minimum and maximum time?! I guess, the timestamp is stored in a kind of Integer and might be platform dependent. (32/64). Is there a possibility to query my installation about what is the minimum and what is the maximum?

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

6 participants