Druid nested groupBy for precise recalculation

Sample SQL

(SELECT channel,isMinor,isNew FROM wikipedia GROUP BY channel,isMinor,isNew)
GROUP BY channel,isMinor
Copy the code

The corresponding json

{
  "queryType": "groupBy"."dataSource": {
    "type": "query"."query": {
      "queryType": "groupBy"."dataSource": {
        "type": "table"."name": "wikipedia"
      },
      "intervals": {
        "type": "intervals"."intervals": [
          "- the 146136543-09-08 t08: did. 096 z / 146140482-04-24 t15:36:27. 903 z"]},"virtualColumns": []."filter": null."granularity": {
        "type": "all"
      },
      "dimensions": [{"type": "default"."dimension": "channel"."outputName": "d0"."outputType": "STRING"
        },
        {
          "type": "default"."dimension": "isMinor"."outputName": "d1"."outputType": "STRING"
        },
        {
          "type": "default"."dimension": "isNew"."outputName": "d2"."outputType": "STRING"}]."aggregations": []."having": null."limitSpec": {
        "type": "default"."columns": []."limit": 100
      },
      "descending": false}},"intervals": {
    "type": "intervals"."intervals": [
      "- the 146136543-09-08 t08: did. 096 z / 146140482-04-24 t15:36:27. 903 z"]},"virtualColumns": []."filter": null."granularity": {
    "type": "all"
  },
  "dimensions": [{"type": "default"."dimension": "d0"."outputName": "d0"."outputType": "STRING"
    },
    {
      "type": "default"."dimension": "d1"."outputName": "d1"."outputType": "STRING"}]."aggregations": [{"type": "count"."name": "count"}]."having": null."limitSpec": {
    "type": "default"."columns": []."limit": 100
  },
  "descending": false
}
Copy the code