# The StatementResponse object

## Attributes

- `statement_id` (string)
  The statement ID is returned upon successfully submitting a SQL statement, and is a required
   reference for all subsequent calls.
- `status` (object)
  - `state` (string)
    Statement execution state:
     - `PENDING`: waiting for warehouse
     - `RUNNING`: running
     - `SUCCEEDED`: execution was successful, result data available for fetch
     - `FAILED`: execution failed; reason for failure described in accompanying error message
     - `CANCELED`: user canceled; can come from explicit cancel call, or timeout with
     `on_wait_timeout=CANCEL`
     - `CLOSED`: execution successful, and statement closed; result no longer available for fetch
    Possible values:
    - `PENDING`
    - `RUNNING`
    - `SUCCEEDED`
    - `FAILED`
    - `CANCELED`
    - `CLOSED`
  - `error` (object)
    - `error_code` (string)
      Possible values:
      - `UNKNOWN`
      - `INTERNAL_ERROR`
      - `TEMPORARILY_UNAVAILABLE`
      - `IO_ERROR`
      - `BAD_REQUEST`
      - `SERVICE_UNDER_MAINTENANCE`
      - `WORKSPACE_TEMPORARILY_UNAVAILABLE`
      - `DEADLINE_EXCEEDED`
      - `CANCELLED`
      - `RESOURCE_EXHAUSTED`
      - `ABORTED`
      - `NOT_FOUND`
      - `ALREADY_EXISTS`
      - `UNAUTHENTICATED`
    - `message` (string)
      A brief summary of the error condition.
  - `sql_state` (string)
    SQLSTATE error code returned when the statement execution fails.
     Only populated when the statement status is `FAILED`.
- `manifest` (object)
  - `format` (string)
    Possible values:
    - `JSON_ARRAY`
    - `ARROW_STREAM`
    - `CSV`
  - `schema` (object)
    - `column_count` (int32)
    - `columns` (array of object)
      - `name` (string)
        The name of the column.
      - `type_text` (string)
        The full SQL type specification.
      - `type_name` (string)
        The name of the base data type. This doesn't include details for complex types such as STRUCT, MAP or ARRAY.
        Possible values:
        - `BOOLEAN`
        - `BYTE`
        - `SHORT`
        - `INT`
        - `LONG`
        - `FLOAT`
        - `DOUBLE`
        - `DATE`
        - `TIMESTAMP`
        - `STRING`
        - `BINARY`
        - `DECIMAL`
        - `INTERVAL`
        - `ARRAY`
        - `STRUCT`
        - `MAP`
        - `CHAR`
        - `NULL`
        - `USER_DEFINED_TYPE`
      - `position` (int32)
        The ordinal position of the column (starting at position 0).
      - `type_precision` (int32)
        Specifies the number of digits in a number. This applies to the DECIMAL type.
      - `type_scale` (int32)
        Specifies the number of digits to the right of the decimal point in a number. This applies to the DECIMAL type.
      - `type_interval_type` (string)
        The format of the interval type.
  - `total_chunk_count` (int32)
    The total number of chunks that the result set has been divided into.
  - `chunks` (array of object)
    Array of result set chunk metadata.
    - `chunk_index` (int32)
      The position within the sequence of result set chunks.
    - `row_offset` (int64)
      The starting row offset within the result set.
    - `row_count` (int64)
      The number of rows within the result chunk.
    - `byte_count` (int64)
      The number of bytes in the result chunk. This field is not available when using `INLINE`
       disposition.
    - `next_chunk_index` (int32)
      When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are no
       more chunks. The next chunk can be fetched with a
       :method:statementexecution/getstatementresultchunkn request.
    - `next_chunk_internal_link` (string)
      When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more
       chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be
       treated as an opaque link. This is an alternative to using `next_chunk_index`.
  - `total_row_count` (int64)
    The total number of rows in the result set.
  - `total_byte_count` (int64)
    The total number of bytes in the result set. This field is not available when using `INLINE`
     disposition.
  - `truncated` (boolean)
    Indicates whether the result is truncated due to `row_limit` or `byte_limit`.
- `result` (object)
  - `external_links` (array of object)
    - `external_link` (string)
      A short-lived cloud-storage URL pointing to a chunk of result data, hosted by an external service, with a short
       expiration time (<= 15 minutes). As this URL contains a temporary credential, it should be considered sensitive
       and the client should not expose this URL in a log.
      **AWS:** On AWS, this is a presigned URL.
      **Azure:** On Azure, this is a SAS URL.
      **GCP:** On GCP, this is a signed URL.
    - `expiration` (string, date-time)
      Indicates the date-time that the given external link will expire and
       becomes invalid, after which point a new `external_link` must be requested.
    - `chunk_index` (int32)
      The position within the sequence of result set chunks.
    - `row_offset` (int64)
      The starting row offset within the result set.
    - `row_count` (int64)
      The number of rows within the result chunk.
    - `byte_count` (int64)
      The number of bytes in the result chunk. This field is not available when using `INLINE`
       disposition.
    - `next_chunk_index` (int32)
      When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are no
       more chunks. The next chunk can be fetched with a
       :method:statementexecution/getstatementresultchunkn request.
    - `next_chunk_internal_link` (string)
      When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more
       chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be
       treated as an opaque link. This is an alternative to using `next_chunk_index`.
  - `data_array` (array of array of object)
    The `JSON_ARRAY` format is an array of arrays of values, where each non-null value is
     formatted as a string. Null values are encoded as JSON `null`.
  - `chunk_index` (int32)
    The position within the sequence of result set chunks.
  - `row_offset` (int64)
    The starting row offset within the result set.
  - `row_count` (int64)
    The number of rows within the result chunk.
  - `byte_count` (int64)
    The number of bytes in the result chunk. This field is not available when using `INLINE`
     disposition.
  - `next_chunk_index` (int32)
    When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are no
     more chunks. The next chunk can be fetched with a
     :method:statementexecution/getstatementresultchunkn request.
  - `next_chunk_internal_link` (string)
    When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more
     chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be
     treated as an opaque link. This is an alternative to using `next_chunk_index`.

## Example

```json
{
  "statement_id": "string",
  "status": {
    "state": "PENDING",
    "error": {},
    "sql_state": "string"
  },
  "manifest": {
    "format": "JSON_ARRAY",
    "schema": {},
    "total_chunk_count": 0,
    "chunks": [
      {}
    ],
    "total_row_count": 0,
    "total_byte_count": 0,
    "truncated": true
  },
  "result": {
    "external_links": [
      {}
    ],
    "data_array": [
      []
    ],
    "chunk_index": 0,
    "row_offset": 0,
    "row_count": 0,
    "byte_count": 0,
    "next_chunk_index": 0,
    "next_chunk_internal_link": "string"
  }
}
```


