-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Please provide a detailed title (e.g. "Broker crashes when using TopN query with Bound filter" instead of just "Broker crashes").
While using the limitSpec in groupBy queries, if we sort on stringLast aggregated fields, the final result isn't sorted.
Affected Version
0.14.2
Description
Based on the ingestion_spec mentioned here - https://druid.apache.org/docs/latest/tutorials/tutorial-ingestion-spec.html
If I have a query like below, it doesn't seem to sort the results. However, if the same field is added in the dimensions list, the results are sorted. However, in my use case I need the sorting on the stringLast value.
Another thing I noticed was if the sorting was done on one of the metrics using longLast aggregation, then that seems to work.
{
"dataSource": {
"type": "table",
"name": "ingestion-tutorial"
},
"queryType": "groupBy",
"intervals": [
"2019-07-23T23:31:40.737/2019-07-24T23:31:40.737"
],
"granularity": "all",
"limitSpec": {
"type": "default",
"columns": [
{
"dimension": "protocol",
"direction": "ascending",
"dimensionOrder": "alphanumeric"
}
],
"limit": 50
},
"dimensions": [
{
"type": "default",
"dimension": "srcIp",
"outputName": "srcIp"
},
{
"type": "default",
"dimension": "dstIp",
"outputName": "dstIp"
}
],
"aggregations": [
{
"type": "stringLast",
"name": "protocol",
"fieldName": "protocol"
}
]
}
Please include as much detailed information about the problem as possible.
-
Cluster size
Single server -
Configurations in use
-
Steps to reproduce the problem
-
The error message or stack traces encountered. Providing more context, such as nearby log messages or even entire logs, can be helpful.
-
Any debugging that you have already done