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

inaccurate errors for top/bottom with N=0 #988

Closed
Dieterbe opened this issue Sep 30, 2014 · 0 comments
Closed

inaccurate errors for top/bottom with N=0 #988

Dieterbe opened this issue Sep 30, 2014 · 0 comments
Assignees

Comments

@Dieterbe
Copy link
Contributor

when selecting top(value,0) or bottom(value,0) it returns Internal Error: runtime error: index out of range. which is not very descriptive.
it should be something like Error: should at least return 1 value or Error: count should be 1 or higher or something.

$ cat influx-issue-988.sql
create db issue-988
\db issue-988
bind
insert into demo values (60000, 0, 10)
insert into demo values (120000, 0, 10)
insert into demo values (300000, 0, 10)
select * from demo
select time, top(value,0) from demo group by time(60s) fill(null) where time > 60s and time < 300s
select time, top(value,1) from demo group by time(60s) fill(null) where time > 60s and time < 300s
select time, bottom(value,0) from demo group by time(60s) fill(null) where time > 60s and time < 300s
select time, bottom(value,1) from demo group by time(60s) fill(null) where time > 60s and time < 300s
delete db issue-988
$ cat influx-issue-988.sql | influx-cli
create db issue-988
\db issue-988
bind
insert into demo values (60000, 0, 10)
insert into demo values (120000, 0, 10)
insert into demo values (300000, 0, 10)
select * from demo
## demo
                time sequence_number               value
       300000.000000        0.000000           10.000000
       120000.000000        0.000000           10.000000
        60000.000000        0.000000           10.000000
select time, top(value,0) from demo group by time(60s) fill(null) where time > 60s and time < 300s
Server returned (400): Internal Error: runtime error: index out of range
select time, top(value,1) from demo group by time(60s) fill(null) where time > 60s and time < 300s
## demo
                time                 top
       300000.000000                  10
       240000.000000               <nil>
       180000.000000               <nil>
       120000.000000                  10
        60000.000000                  10
select time, bottom(value,0) from demo group by time(60s) fill(null) where time > 60s and time < 300s
Server returned (400): Internal Error: runtime error: index out of range
select time, bottom(value,1) from demo group by time(60s) fill(null) where time > 60s and time < 300s
## demo
                time              bottom
       300000.000000                  10
       240000.000000               <nil>
       180000.000000               <nil>
       120000.000000                  10
        60000.000000                  10
delete db issue-988
@dgnorton dgnorton added review and removed 1 - Ready labels Oct 23, 2014
toddboom added a commit that referenced this issue Oct 23, 2014
Fix #988: top/bottom error messages
@dgnorton dgnorton removed the review label Oct 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants