Sorting is not working

Hi,

I am trying to sort the result in groupby but it seems it is not working.

Query 1 :

{

“jsonClass”: “GroupByQuerySpec”,

“queryType”: “groupBy”,

“dataSource”: “test”,

“dimensions”: [{

“jsonClass”: “DefaultDimensionSpec”,

“type”: “default”,

“dimension”: “query”,

“outputName”: “searchterm”

}],

“granularity”: “all”,

“aggregations”: [{

“jsonClass”: “FunctionAggregationSpec”,

“type”: “longSum”,

“name”: “volume”,

“fieldName”: “count”

}],

"OrderByColumnSpecs": {

"dimension": “volume”,

"direction": "descending"

},

"OrderByColumnSpecs" is not part of the query spec. What you want is
the limitSpec from

http://druid.io/docs/0.8.2/querying/groupbyquery.html

And then in your "columns" field on there, you specify the "order by
specs". So something like your second query but replace "orderBy"
with "limitSpec":

"limitSpec":{"type":"default","limit":3,"columns":[{"dimension":"volume","direction":"descending"}]}

This works man. Thanks .