{
  "data": {
    "diagnostics": {
      "datasourceType": "sqlite",
      "defaultDialect": "sqlite",
      "dialectSource": "namespace-datasource-type",
      "namespace": "chinook",
      "namespaceDatasourceId": "chinook-sqlite",
      "namespaceDatasourceStatus": "active",
      "resolvedDialect": "sqlite"
    },
    "mode": "validate",
    "params": [],
    "scriptKind": "compose",
    "valid": true,
    "value": {
      "plans": {
        "params": [
          "2012-01-01 00:00:00",
          "2013-01-01 00:00:00"
        ],
        "sql": "SELECT customer_id, customer_name, total_amount, bill_count\nFROM (WITH cte_0 AS (select\tt1.CustomerId \"customer_id\",\tt1.FirstName || ' ' || t1.LastName \"customer_name\"\tfrom Customer t1\t order by t1.CustomerId asc,\tt1.CustomerId desc),\ncte_1 AS (select\tt1.CustomerId \"bill_customer_id\",\tSUM(t1.Total) \"total_amount\",\tCOUNT(t1.InvoiceId) \"bill_count\"\tfrom Invoice t1\t where  1=1  and \tt1.InvoiceDate >=?  and \tt1.InvoiceDate <? \tgroup by t1.CustomerId)\nSELECT cte_0.customer_id, cte_0.customer_name, cte_1.bill_customer_id, cte_1.total_amount, cte_1.bill_count\nFROM cte_0\nLEFT JOIN cte_1 ON cte_0.customer_id = cte_1.bill_customer_id) AS cte_2\nORDER BY customer_id ASC\nLIMIT 100"
      }
    },
    "warnings": []
  },
  "diagnostics": {
    "attributes": {
      "datasourceType": "sqlite",
      "defaultDialect": "sqlite",
      "dialectSource": "namespace-datasource-type",
      "namespace": "chinook",
      "namespaceDatasourceId": "chinook-sqlite",
      "namespaceDatasourceStatus": "active",
      "resolvedDialect": "sqlite"
    },
    "warnings": []
  },
  "engine": "java",
  "runtimeApiVersion": "foggy-runtime-api/v1",
  "success": true
}
