Submitting GroupBy queries to the JSON query API returns a 500 when given duplicate output name columns. For example:
{
"context": {"queryId": "010b5fa5-9a45-4614-8c0b-acaa747c2af0"},
"dataSource": "Famous_Duets",
"aggregations": [{
"fieldName": "count",
"name": "count",
"type": "count"
}],
"dataSource": "my_datasource",
"dimensions": [{
"dimension": "Female_Singer",
"outputName": "Singer",
"type": "default"
}, {
"dimension": "Male_Singer",
"outputName": "Singer",
"type": "default"
}],
"granularity": "all",
"intervals": ["2017-06-20T14:51:00Z/2017-06-20T18:27:00Z"],
"queryType": "groupBy"
}
Note that Singer is the outputName for more than one groupBy dimension. The query response is:
{"error":"Unknown exception"}
Obviously, the query is malformed, but returning the error in this response might be helpful. The way I tracked it down was in the logs:
2017-06-20T18:49:09,604 INFO [qtp1665324560-197[groupBy_Famous_Duets_010b5fa5-9a45-4614-8c0b-acaa747c2af0]] io.druid.server.QueryResource - Unknown exception [010b5fa5-9a45-4614-8c0b-acaa747c2af0]
Later in the logs, a log containing:
Dimension[Singer] occurred more than once in InputRow
Tipped me off to what the error was.
Submitting GroupBy queries to the JSON query API returns a 500 when given duplicate output name columns. For example:
Note that
Singeris the outputName for more than one groupBy dimension. The query response is:Obviously, the query is malformed, but returning the error in this response might be helpful. The way I tracked it down was in the logs:
Later in the logs, a log containing:
Tipped me off to what the error was.