mirror of https://github.com/apache/druid.git
Update post-aggregations.md (#5237)
* Update post-aggregations.md I think this is more clear. I am not sure how multiplying by 100 is involved in averaging... * Update post-aggregations.md adding additional aggregator * Update post-aggregations.md
This commit is contained in:
parent
e255d66b85
commit
77bb2f9c9f
|
@ -162,14 +162,35 @@ The format of the query JSON is as follows:
|
|||
"postAggregations" : [{
|
||||
"type" : "arithmetic",
|
||||
"name" : "average",
|
||||
"fn" : "/",
|
||||
"fields" : [
|
||||
{ "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" },
|
||||
{ "type" : "fieldAccess", "name" : "rows", "fieldName" : "rows" }
|
||||
]
|
||||
}]
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"aggregations" : [
|
||||
{ "type" : "doubleSum", "name" : "tot", "fieldName" : "total" },
|
||||
{ "type" : "doubleSum", "name" : "part", "fieldName" : "part" }
|
||||
],
|
||||
"postAggregations" : [{
|
||||
"type" : "arithmetic",
|
||||
"name" : "part_percentage",
|
||||
"fn" : "*",
|
||||
"fields" : [
|
||||
{ "type" : "arithmetic",
|
||||
"name" : "div",
|
||||
"name" : "ratio",
|
||||
"fn" : "/",
|
||||
"fields" : [
|
||||
{ "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" },
|
||||
{ "type" : "fieldAccess", "name" : "rows", "fieldName" : "rows" }
|
||||
{ "type" : "fieldAccess", "name" : "part", "fieldName" : "part" },
|
||||
{ "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" }
|
||||
]
|
||||
},
|
||||
{ "type" : "constant", "name": "const", "value" : 100 }
|
||||
|
|
Loading…
Reference in New Issue