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

Fill doesn't work correctly when no lower time bound specified #8230

Closed
dgnorton opened this issue Mar 30, 2017 · 1 comment
Closed

Fill doesn't work correctly when no lower time bound specified #8230

dgnorton opened this issue Mar 30, 2017 · 1 comment
Assignees
Labels

Comments

@dgnorton
Copy link
Contributor

dgnorton commented Mar 30, 2017

Given a database with the following two values:

> select watts from pwr where time <= 3600000000000
name: pwr
time                 watts
----                 -----
1970-01-01T00:00:00Z 100
1970-01-01T01:00:00Z 500

The following query:

SELECT mean(watts) FROM pwr WHERE time <= 3600000000000 GROUP BY time(1h) LIMIT 5

Returns:

name: pwr
time                 mean
----                 ----
1970-01-01T00:00:00Z 100
1677-09-21T01:00:00Z 
1677-09-21T02:00:00Z 
1677-09-21T03:00:00Z 
1677-09-21T04:00:00Z

Note that the filled dates are out of order.

Adding a lower time bound:

SELECT mean(watts) FROM pwr WHERE time >= -7200000000000 AND time <= 3600000000000 GROUP BY time(1h) LIMIT 5

Gives the expected results:

name: pwr
time                 mean
----                 ----
1969-12-31T22:00:00Z 
1969-12-31T23:00:00Z 
1970-01-01T00:00:00Z 100
1970-01-01T01:00:00Z 500

This zip file contains a repro script.

@jsternberg jsternberg self-assigned this Mar 30, 2017
@jsternberg
Copy link
Contributor

It looks like window computation when the time is very high or very low causes an overflow.

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

No branches or pull requests

2 participants