Query Data Source "unsupported" error

Hi,

I’m using Druid version 0.7.3 and I’m trying to use a “query data source” as a dataSource in a groupBy query. See below:

{

“queryType”: “groupBy”,

“dataSource”: {

“type”: “query”,

“query”: {

“queryType”: “groupBy”,

“dataSource”: “events”,

“granularity”: “day”,

“dimensions”: [“userid”],

“aggregations”: [

 {"type": "count", "fieldName": "userid", "name": "user"}

],

“intervals”: [ “2010-01-01/2020-01-01” ]

}

},

“granularity”: “day”,

“dimensions”: [“userid”],

“aggregations”: [

{“type”: “count”, “fieldName”: “userid”, “name”: “user”}

],

“intervals”: [ “2010-01-01/2020-01-01” ]

}

When I try to run the query I get the following error:

{

“error” : “data source type ‘io.druid.query.QueryDataSource’ unsupported”

}%

Apparently, the documentation says that nested groupBy queries using queries as data sources are allowed. But if one takes a look into the source code (druid/server/src/main/java/io/druid/server/coordination/ServerManager.java) it seems that it is not allowed to use a query as a data source:

DataSource dataSource = query.getDataSource();
if (dataSource instanceof QueryDataSource) {
throw new UnsupportedOperationException(“data source type '” + dataSource.getClass().getName() + “’ unsupported”);
}

Has anyone encountered the same problem?

Any help would be very appreciated.

Thanks !

Miquel

Nested group-by queries must be sent to Broker. Are you sending your query to broker?

– Himanshu

This was the point. Now it works like charm.

Thanks a lot !!

Miquel

El dimarts, 2 juny de 2015 17:40:39 UTC+2, Himanshu Gupta va escriure:

Hi Miquel,
Im facing issue for this query.Its returning empty result for all cases.Can you please give a suggestion?