You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/08/07 10:20:10 UTC

[GitHub] [druid] BigRantLing edited a comment on issue #10236: How to implement "case when" by Native queries

BigRantLing edited a comment on issue #10236:
URL: https://github.com/apache/druid/issues/10236#issuecomment-670444651


    @Mxdcp, Hi,
   [Druid filtered aggregator](https://druid.apache.org/docs/latest/querying/aggregations.html#filtered-aggregator)  may be help you . I think it can be parsed to native query like below:    
   
   ```json 
   {
       "queryType":"queryType",
       ....
       "aggregations":[
           {
               "type":"filtered",
               "filter":{
                   "type":"selector",
                   "dimension":"column_A",
                   "value":"value_one"
               },
               "aggregator":{
                   "type":"longSum",
                   "fieldName":"column_B",
                   "name":"sum_B"
               }
           },
           {
               "type":"filtered",
               "filter":{
                   "type":"selector",
                   "dimension":"column_A",
                   "value":"value_two"
               },
               "aggregator":{
                   "type":"longSum",
                   "fieldName":"column_D",
                   "name":"sum_D"
               }
           }
       ]
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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