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