我正在尝试获取平均值,为此,我获得了longSum和distinctCount,并使用算术函数来获取该值。但是,由于我在算术中使用distinctCount,因此druid失败并显示500 Error。
任何其他值(最小值,总和,计数)都可以正常工作。 唯一计数的值本身可以工作,并且我可以在表中获取输出。
"aggregations": [
{
"fieldNames": [
"unifiedProjectId"
],
"name": "count_distinct__unifiedProject",
"type": "cardinality"
},
{
"fieldName": "executionDurationInMinutesPerSite",
"name": "sum__executionDurationInMinutesPerSite",
"type": "doubleSum"
}
]
"postAggregations": [
{
"fields": [
{
"fieldName": "sum__executionDurationInMinutesPerSite",
"name": "sum__executionDurationInMinutesPerSite",
"type": "fieldAccess"
},
{
"fieldName": "count_distinct__unifiedProject",
"name": "count_distinct__unifiedProject",
"type": "fieldAccess"
}
],
"fn": "/",
"name": "avg_execution_time_per_project",
"type": "arithmetic"
}
]