{
  "$id": "https://opendatafabric.org/schemas/engines/v1alpha1/RawQueryResponse",
  "$schema": "https://opendatafabric.org/schemas/engines/v1alpha1/meta/EngineMessage",
  "description": "Sent by an engine to coordinator when performing the raw query operation",
  "unevaluatedProperties": false,
  "$defs": {
    "Progress": {
      "type": "object",
      "required": [],
      "properties": {},
      "description": "Reports query progress"
    },
    "Success": {
      "type": "object",
      "required": [
        "numRecords"
      ],
      "properties": {
        "numRecords": {
          "type": "integer",
          "format": "uint64",
          "description": "Number of records produced by the query"
        }
      },
      "description": "Query executed successfully"
    },
    "InvalidQuery": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "Explanation of an error"
        }
      },
      "description": "Query did not pass validation"
    },
    "InternalError": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "Brief description of an error"
        },
        "backtrace": {
          "type": "string",
          "description": "Details of an error (e.g. a backtrace)"
        }
      },
      "description": "Internal error during query execution"
    }
  },
  "oneOf": [
    {
      "allOf": [
        {
          "properties": {
            "kind": {
              "type": "string",
              "const": "Progress"
            }
          },
          "required": [
            "kind"
          ]
        },
        {
          "$ref": "#/$defs/Progress"
        }
      ]
    },
    {
      "allOf": [
        {
          "properties": {
            "kind": {
              "type": "string",
              "const": "Success"
            }
          },
          "required": [
            "kind"
          ]
        },
        {
          "$ref": "#/$defs/Success"
        }
      ]
    },
    {
      "allOf": [
        {
          "properties": {
            "kind": {
              "type": "string",
              "const": "InvalidQuery"
            }
          },
          "required": [
            "kind"
          ]
        },
        {
          "$ref": "#/$defs/InvalidQuery"
        }
      ]
    },
    {
      "allOf": [
        {
          "properties": {
            "kind": {
              "type": "string",
              "const": "InternalError"
            }
          },
          "required": [
            "kind"
          ]
        },
        {
          "$ref": "#/$defs/InternalError"
        }
      ]
    }
  ]
}
