Count Total Results Of groupBy Query

Hi,
How can I count total results of groupByQuery, for example:

{

“queryType”:“groupBy”,

“dataSource”:“test_data”,

“granularity”:“none”,

“dimensions”:[

“column1”,

“column2”,

“column3”

],

“limitSpec”:{

“type”:“default”,

“limit”:100,

“columns”:[

{

“dimension”:“column1”,

“direction”:“ascending”,

“dimensionOrder”:“lexicographic”

}

]

},

“filter”:null,

“aggregations”:[

{

“type”:“count”,

“name”:“count”

}

],

“intervals”:[

“2016-02-01T09:45:33.000/2100-01-03T00:00:00.000”

]

}

``

If you want to know how many results came back, you could do a nested query where the outer query just does a count aggregator with no dimensions.

hi Gian,
thanks for quick response!
can you please point me to the documentation about nested queries?

what will nested query return if I use limit set to 100 but there are 200 results available?

sorry, I meant what outer query will return if nested use limit 100 but gives 200 results without limit.

Nested queries are documented here: http://druid.io/docs/latest/querying/groupbyquery.html#nested-groupbys

They just count the query results, though, so if the limit is 100 and there were 200 results, they’ll return 100. There’s no way to get both the limited result set and the total number of results sans-limit in one query, but you could do it with two queries.