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

Group by multiple columns #90

Closed
hvt opened this issue Dec 3, 2013 · 0 comments
Closed

Group by multiple columns #90

hvt opened this issue Dec 3, 2013 · 0 comments

Comments

@hvt
Copy link

hvt commented Dec 3, 2013

I don't know if this is already available, but just not working. Or that it is a feature request. So consider this issue both a bug report and a feature request :]. Let's start with the feature part

I think it would be fantastic when grouping on multiple (>2) columns (including the time function) is possible. Assume the following serie:

 time        | fr      | to       | app        | kb
-----------------------------------------------------
 now() - 1hr | home    | office   | ssl        | 10
 now() - 1hr | home    | office   | ssl        | 20
 now() - 1hr | home    | internet | http       | 30
 now() - 1hr | home    | office   | http       | 40
 now()       | home    | internet | skype      | 50
 now()       | home    | office   | lotus      | 60
 now()       | home    | internet | skype      | 70

It would be great if the following query:

    select sum(kb)
    from test
    group by time(1h), to, app

Would result in:

 time        | to       | app        | sum(kb)
-----------------------------------------------
 now() - 1hr | office   | ssl        | 30
 now() - 1hr | internet | http       | 30
 now() - 1hr | office   | http       | 40
 now()       | office   | lotus      | 60
 now()       | internet | skype      | 120

Then finally, the bug report which made me doubt whether this feature is already available/not:

When I issue the listed query, I get back an empty array, and the following is logged:

********************************BUG********************************
Database: mydb
Query: [select sum(kb) from test group by time(1h), to, app]
Error: runtime error: index out of range. Stacktrace: goroutine 20452 [running]:
engine.func·004()
    /home/vagrant/influxdb/src/engine/engine.go:28 +0x116
protocol.(*Point).GetFieldValue(0xc20061fb00, 0xffffffffffffffff, 0x4ec9f329dcc00, 0x2)
    /home/vagrant/influxdb/src/protocol/protocol_extensions.go:47 +0x81
engine.func·013(0xc20061fb00, 0xc201f72460, 0x0)
    /home/vagrant/influxdb/src/engine/engine.go:172 +0x7a
engine.func·017(0xc201f72460, 0xc201f72460, 0xc201f72460)
    /home/vagrant/influxdb/src/engine/engine.go:280 +0x1ca
datastore.(*LevelDbDatastore).sendBatch(0xc2000e8f90, 0xc2004b6090, 0xc201f72780, 0xc20061f840, 0x8, ...)
    /home/vagrant/influxdb/src/datastore/leveldb_datastore.go:502 +0x162
datastore.(*LevelDbDatastore).executeQueryForSeries(0xc2000e8f90, 0xc201667d96, 0x5, 0xc2009d3280, 0x8, ...)
    /home/vagrant/influxdb/src/datastore/leveldb_datastore.go:474 +0xe99
datastore.(*LevelDbDatastore).ExecuteQuery(0xc2000e8f90, 0xc2000f55a0, 0xc200157ee0, 0xc201667d96, 0x5, ...)
    /home/vagrant/influxdb/src/datastore/leveldb_datastore.go:216 +0x3bd
coordinator.
@ghost ghost assigned jvshahid Dec 3, 2013
jvshahid pushed a commit that referenced this issue Aug 12, 2014
Simplify Protobuf Encoding by Removing Extraneous Buffers
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