{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elastic/json-schema/elastic-esql-types-esql-result-schema.json",
  "title": "esql._types.EsqlResult",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elastic-esql-api-openapi.yml#/components/schemas/esql._types.EsqlResult",
  "type": "object",
  "properties": {
    "took": {
      "allOf": [
        {
          "$ref": "#/$defs/_types.DurationValueUnitMillis"
        }
      ]
    },
    "is_partial": {
      "type": "boolean"
    },
    "all_columns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/esql._types.EsqlColumnInfo"
      }
    },
    "columns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/esql._types.EsqlColumnInfo"
      }
    },
    "values": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/_types.FieldValue"
        }
      }
    },
    "_clusters": {
      "description": "Cross-cluster search information. Present if `include_ccs_metadata` was `true` in the request\nand a cross-cluster search was performed.",
      "allOf": [
        {
          "$ref": "#/$defs/esql._types.EsqlClusterInfo"
        }
      ]
    },
    "profile": {
      "description": "Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable.",
      "type": "object"
    }
  },
  "required": [
    "columns",
    "values"
  ],
  "$defs": {
    "_types.DurationValueUnitMillis": {
      "allOf": [
        {
          "$ref": "#/$defs/_types.UnitMillis"
        }
      ]
    },
    "_types.ErrorCause": {
      "description": "Cause and details about a request failure. This class defines the properties common to all error types.\nAdditional details are also provided, that depend on the error type.",
      "type": "object",
      "properties": {
        "type": {
          "description": "The type of error",
          "type": "string"
        },
        "reason": {
          "description": "A human-readable explanation of the error, in English.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": [
                "string",
                "null"
              ]
            }
          ]
        },
        "stack_trace": {
          "description": "The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.",
          "type": "string"
        },
        "caused_by": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.ErrorCause"
            }
          ]
        },
        "root_cause": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/_types.ErrorCause"
          }
        },
        "suppressed": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/_types.ErrorCause"
          }
        }
      },
      "required": [
        "type"
      ]
    },
    "_types.FieldValue": {
      "description": "A field value.",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "type": "boolean"
        },
        {
          "type": [
            "string",
            "null"
          ]
        }
      ]
    },
    "_types.IndexName": {
      "type": "string"
    },
    "_types.NodeId": {
      "type": "string"
    },
    "_types.UnitMillis": {
      "description": "Time unit for milliseconds",
      "type": "number"
    },
    "esql._types.EsqlClusterDetails": {
      "type": "object",
      "properties": {
        "status": {
          "allOf": [
            {
              "$ref": "#/$defs/esql._types.EsqlClusterStatus"
            }
          ]
        },
        "indices": {
          "type": "string"
        },
        "took": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.DurationValueUnitMillis"
            }
          ]
        },
        "_shards": {
          "allOf": [
            {
              "$ref": "#/$defs/esql._types.EsqlShardInfo"
            }
          ]
        },
        "failures": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/esql._types.EsqlShardFailure"
          }
        }
      },
      "required": [
        "status",
        "indices"
      ]
    },
    "esql._types.EsqlClusterInfo": {
      "type": "object",
      "properties": {
        "total": {
          "type": "number"
        },
        "successful": {
          "type": "number"
        },
        "running": {
          "type": "number"
        },
        "skipped": {
          "type": "number"
        },
        "partial": {
          "type": "number"
        },
        "failed": {
          "type": "number"
        },
        "details": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/esql._types.EsqlClusterDetails"
          }
        }
      },
      "required": [
        "total",
        "successful",
        "running",
        "skipped",
        "partial",
        "failed",
        "details"
      ]
    },
    "esql._types.EsqlClusterStatus": {
      "type": "string",
      "enum": [
        "running",
        "successful",
        "partial",
        "skipped",
        "failed"
      ]
    },
    "esql._types.EsqlColumnInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ]
    },
    "esql._types.EsqlShardFailure": {
      "type": "object",
      "properties": {
        "shard": {
          "type": "number"
        },
        "index": {
          "oneOf": [
            {
              "$ref": "#/$defs/_types.IndexName"
            },
            {
              "type": [
                "string",
                "null"
              ]
            }
          ]
        },
        "node": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.NodeId"
            }
          ]
        },
        "reason": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.ErrorCause"
            }
          ]
        }
      },
      "required": [
        "shard",
        "index",
        "reason"
      ]
    },
    "esql._types.EsqlShardInfo": {
      "type": "object",
      "properties": {
        "total": {
          "type": "number"
        },
        "successful": {
          "type": "number"
        },
        "skipped": {
          "type": "number"
        },
        "failed": {
          "type": "number"
        }
      },
      "required": [
        "total"
      ]
    }
  }
}