Apache Livy · JSON Structure

Rest Api Statement Structure

A code statement executed in a session

Type: object Properties: 4
Big DataInteractive ComputingOpen SourceRESTSpark

Statement is a JSON Structure definition published by Apache Livy, describing 4 properties. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

id code state output

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "type": "object",
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/apache-livy/refs/heads/main/json-structure/rest-api-statement-structure.json",
  "name": "Statement",
  "description": "A code statement executed in a session",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Statement identifier",
      "example": 0
    },
    "code": {
      "type": "string",
      "description": "The code that was executed",
      "example": "sc.parallelize([1,2,3]).count()"
    },
    "state": {
      "type": "string",
      "description": "Statement execution state",
      "enum": [
        "waiting",
        "running",
        "available",
        "error",
        "cancelling",
        "cancelled"
      ],
      "example": "available"
    },
    "output": {
      "type": "object",
      "description": "Statement output",
      "properties": {
        "status": {
          "type": "string",
          "example": "ok"
        },
        "execution_count": {
          "type": "integer",
          "example": 0
        },
        "data": {
          "type": "object"
        }
      }
    }
  }
}