Query Parsing

Check an analytics query being written

Checks request constraints and server limits for an analytics draft. When those pass, translates the whole query once and reports its first SQL failure. Diagnostics name the field when it is known, or the query as a whole. Draft feedback is advisory; submission still validates against the actual table and engine. The query is deliberately not bean-validated on the way in, so incomplete drafts receive diagnostics rather than a rejected request.

post/v1/query/analytics-draft

Request

  • Base URL
    https://docs.grepr.ai (the document declares no server; this is the origin it was published from)
  • Auth
    • API key in header GREPR-API-KEY
    • or OpenID Connect (https://grepr-prod.us.auth0.com/.well-known/openid-configuration)

Request body

datasetIdstring

Dataset the query reads. Supplying it checks the scan budget against that dataset's ceiling and requires VIEW permission on it.

scanBudgetBytesinteger required

Bytes the run may scan, checked against the organization's ceiling. Zero stands for a budget field left empty and is reported as a diagnostic.

Example request

{
  "query": {
    "predicate": {
      "query": "service:grepr-service-1"
    },
    "window": {
      "size": "PT20.345S",
      "slide": "PT20.345S"
    }
  },
  "scanBudgetBytes": 107374182400
}

Response

Diagnostics for the analytics draft.

Example response

{
  "diagnostics": [
    {
      "fix": {
        "addGroupBy": "service"
      },
      "message": "Result aliases must be unique.",
      "path": "select[1].alias"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.