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

PERCENTILE panics database when run on integer values #3065

Closed
beckettsean opened this issue Jun 19, 2015 · 2 comments
Closed

PERCENTILE panics database when run on integer values #3065

beckettsean opened this issue Jun 19, 2015 · 2 comments

Comments

@beckettsean
Copy link
Contributor

Series exists and has data:

> select * from foobar
name: foobar
tags: key=val1
time                value
----                -----
2015-06-18T19:09:52.947299286Z  1
2015-06-18T19:10:01.619062526Z  2
2015-06-18T19:10:03.171388731Z  3


name: foobar
tags: key=val2
time                value
----                -----
2015-06-18T19:10:06.339544273Z  3
2015-06-18T19:10:07.611584869Z  4
2015-06-18T19:10:08.763866774Z  5

PERCENTILE query panics the database

> select percentile(value, 30) from foobar
ERR: Get http://localhost:8086/query?db=mydb&q=select+percentile%28value%2C+30%29+from+foobar: EOF

log trace

panic: interface conversion: interface is int64, not float64

goroutine 90 [running]:
github.com/influxdb/influxdb/influxql.func·021(0xc2080e8540, 0x1, 0x1, 0x0, 0x0)
        /private/tmp/influxdb20150611-31144-myuhfv/influxdb-0.9.0/src/github.com/influxdb/influxdb/influxql/functions.go:1061 +0x2ea
github.com/influxdb/influxdb/influxql.(*MapReduceJob).processAggregate(0xc2081bb0a0, 0xc208136750, 0xc2080e8530, 0xc20815cba0, 0x1, 0x1, 0x0, 0x0)
        /private/tmp/influxdb20150611-31144-myuhfv/influxdb-0.9.0/src/github.com/influxdb/influxdb/influxql/engine.go:784 +0x33d
github.com/influxdb/influxdb/influxql.(*MapReduceJob).Execute(0xc2081bb0a0, 0xc208148cc0, 0x0)
        /private/tmp/influxdb20150611-31144-myuhfv/influxdb-0.9.0/src/github.com/influxdb/influxdb/influxql/engine.go:170 +0x8ca
github.com/influxdb/influxdb/influxql.(*Executor).execute(0xc20803fc00, 0xc208148cc0)
        /private/tmp/influxdb20150611-31144-myuhfv/influxdb-0.9.0/src/github.com/influxdb/influxdb/influxql/engine.go:926 +0xba
created by github.com/influxdb/influxdb/influxql.(*Executor).Execute
        /private/tmp/influxdb20150611-31144-myuhfv/influxdb-0.9.0/src/github.com/influxdb/influxdb/influxql/engine.go:905 +0x5a
@beckettsean
Copy link
Contributor Author

Verified it only panics if the field values are int64. If they are float64 it works fine:

> insert bat fkey=3.2
> insert bat fkey=3.2
> insert bat fkey=3.2

> insert baz fkey=3
> insert baz fkey=3
> insert baz fkey=3

> select percentile(fkey, 50) from bat
name: bat
---------
time            percentile
1970-01-01T00:00:00Z    3.2

> select percentile(fkey, 50) from baz
ERR: Get http://localhost:8086/query?db=mydb&q=select+percentile%28fkey%2C+50%29+from+baz: EOF

@beckettsean beckettsean changed the title PERCENTILE is broken, panics database PERCENTILE panics database when run on integer values Jun 19, 2015
@jwilder
Copy link
Contributor

jwilder commented Jun 26, 2015

Verified fixed by #2917

@jwilder jwilder closed this as completed Jun 26, 2015
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

2 participants