jihoonson commented on issue #5566: Applying doubleSum over doubleFirst 
aggregations in nested groupBy fails
URL: 
https://github.com/apache/incubator-druid/issues/5566#issuecomment-408567669
 
 
   Hi all,
   
   `DoubleFirstAggregator` returns `SerializedPair`s  which is the intermediate 
format to merging doubleFirst values from multiple historicals. So, to compute 
some aggregations like `sum` over `doubleFirst`, you first need to _finalize_ 
the intermediate result to be the final format which contains only the double 
value. You can use `expression` postAggregator to do this. Here is an example.
   
   ```json
   {
     "queryType": "groupBy",
     "dataSource": {
       "type": "query",
       "query": {
         "queryType": "groupBy",
         "dataSource": "twitter",
         "aggregations": [
           {
             "type": "doubleFirst",
             "name": "tweets",
             "fieldName": "tweets"
           }
         ],
         "postAggregations": [
           { "type" : "expression", "name": "tweets_first", "expression" : 
"tweets" }
         ],
         "dimensions": [
           "lang"
         ],
         "intervals": "2018-07-27/2018-07-28",
         "granularity": "hour"
       }
     },
     "intervals": "2018-07-27/2018-07-28",
     "granularity": "hour",
     "aggregations": [
       {
         "type": "doubleSum",
         "name": "value_num",
         "fieldName": "tweets_first"
       }
     ],
     "dimensions": []
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to