DDSQL

Fetch the result of a DDSQL query

Poll a previously submitted DDSQL query for results. Pass the opaque query_id returned by a prior ExecuteDdsqlTabularQuery (or by a prior FetchDdsqlTabularQuery that returned state: running) and the server returns either a running state to poll again or a completed state with the column-major result set inlined.

For a scoped application key, include timeseries_query in its scopes. Fetch results as the same user and organization that submitted the query. The user or service account that owns the application key must have the data access permissions required by the queried data sources through their roles.

post/api/v2/ddsql/query/tabular/fetch

Request

Request body

Example request

{
  "data": {
    "attributes": {
      "query_id": "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="
    },
    "type": "ddsql_query_fetch_request"
  }
}

Response

OK

Example response

{
  "data": {
    "attributes": {
      "columns": [
        {
          "name": "service",
          "type": "VARCHAR",
          "values": [
            "web-store",
            "checkout"
          ]
        }
      ],
      "query_id": "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==",
      "state": "completed",
      "warnings": [
        "Query result was truncated at the configured row_limit."
      ]
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "ddsql_query_response"
  },
  "meta": {
    "elapsed": 87,
    "request_id": "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082"
  }
}

Changes

Changes to this operation have not been checked yet.