{
  "data": {
    "debug": {
      "durationMs": 3,
      "extra": {
        "aggSql": "SELECT SUM(tx.\"__foggy_agg_state_0\") AS \"amount\",\n       SUM(tx.\"__foggy_agg_state_1\") AS \"bills\",\n       (SUM(tx.\"__foggy_agg_state_2\") / NULLIF(SUM(tx.\"__foggy_agg_state_3\"), 0)) AS \"averageAmount\",\n       COUNT(*) AS \"total\"\nFROM (\nselect\tSUM(t1.Total) \"amount\",\tCOUNT(t1.InvoiceId) \"bills\",\t(SUM(t1.Total) / NULLIF(COUNT(t1.InvoiceId), 0)) \"averageAmount\",\tSUM(t1.Total) \"__foggy_agg_state_0\",\tCOUNT(t1.InvoiceId) \"__foggy_agg_state_1\",\tSUM(t1.Total) \"__foggy_agg_state_2\",\tCOUNT(t1.InvoiceId) \"__foggy_agg_state_3\"\tfrom Invoice t1\t where  1=1  and \tt1.InvoiceDate >=?  and \tt1.InvoiceDate <? \n) tx",
        "params": [
          "2012-01-01 00:00:00",
          "2013-01-01 00:00:00"
        ],
        "sql": "select\tSUM(t1.Total) \"amount\",\tCOUNT(t1.InvoiceId) \"bills\",\t(SUM(t1.Total) / NULLIF(COUNT(t1.InvoiceId), 0)) \"averageAmount\"\tfrom Invoice t1\t where  1=1  and \tt1.InvoiceDate >=?  and \tt1.InvoiceDate <? "
      },
      "normalized": {
        "groupBy": [
          {
            "agg": "SUM",
            "field": "amount"
          },
          {
            "agg": "COUNT",
            "field": "bills"
          },
          {
            "field": "averageAmount"
          }
        ],
        "slice": [
          {
            "field": "invoiceDate",
            "op": "[)",
            "value": [
              "2012-01-01",
              "2013-01-01"
            ]
          }
        ]
      }
    },
    "hasNext": false,
    "items": [
      {
        "amount": 477.53,
        "averageAmount": 5.753373493975904,
        "bills": 83
      }
    ],
    "pagination": {
      "hasMore": false,
      "limit": 2,
      "rangeDescription": "显示第 1-1 条",
      "returned": 1,
      "start": 0
    },
    "schema": {
      "columns": [
        {
          "name": "amount"
        },
        {
          "name": "bills"
        },
        {
          "name": "averageAmount"
        }
      ],
      "summary": "按 averageAmount 分组，统计 amount、bills，返回 1 条数据"
    },
    "total": 0
  },
  "diagnostics": {
    "attributes": {},
    "warnings": []
  },
  "engine": "java",
  "runtimeApiVersion": "foggy-runtime-api/v1",
  "success": true
}
