Questions regarding query syntax

In the last day I looked extensively how the query are build. And encountered some parts which confused me.

  • Field accessor post-aggregator
  • in the corresponding part of the doc the syntax is shown as:
    { "type" : "fieldAccess", "fieldName" : <aggregator_name> }
    
    ``
  • `
    
    { “type” : “fieldAccess”, “name” : “tot”, “fieldName” : “tot” },
  • In the queries we run, we use the second syntax. So my question is this an error in the documentation?
  • How deep can i encapsulate post-aggregators?
  • the example shows that you can do it once, but are their any restricts how often it can be done?
    "postAggregations" : [{
        "type"   : "arithmetic",
        "name"   : "average",
        "fn"     : "*",
        "fields" : [
           { "type"   : "arithmetic",
             "name"   : "div",
             "fn"     : "/",
             "fields" : [
               { "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" },
               { "type" : "fieldAccess", "name" : "rows", "fieldName" : "rows" }
             ]
           },
           { "type" : "constant", "name": "const", "value" : 100 }
        ]
      }]
    

With best regards

``

Martin Schneider

Hi Martin, see inline.

Nest* not next :stuck_out_tongue:

Thanks for the reply. Issue is created: https://github.com/druid-io/druid/issues/1584.

I wish you a nice weekend.

Hi Martin, do you mind submitting a fix for this issue?

You can fix it here:

https://github.com/druid-io/druid/blob/master/docs/content/querying/post-aggregations.md

We’ll get it merged and available as part of 0.8.1

It’s done. (https://github.com/MarConSchneid/druid/commit/d7e973c8349e93dd8471f285d1718a392c7c9733)

Hi Martin, do you mind submitting that as a PR to https://github.com/druid-io/druid?