All Products
Search
Document Center

AnalyticDB:CancelSparkWarehouseBatchSQL

Last Updated:Nov 10, 2025

Cancels the execution of a Spark SQL statement.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
adb:CancelSparkWarehouseBatchSQLupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
QueryIdstringYes

The query ID of the Spark SQL statement.

sq202501011001s****
DBClusterIdstringNo

The cluster ID.

amv-uf6485635f***
AgencystringNo

The name of the client, which can be up to 16 characters in length. Specify a descriptive name that makes it easy to identify.

DMS

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

771C5FAA-530F-52F7-B84D-EBAD45***
DataSparkBatchSQL

The returned data.

123

Examples

Sample success responses

JSONformat

{
  "RequestId": "771C5FAA-530F-52F7-B84D-EBAD45***",
  "Data": {
    "QueryId": "sq172352176****",
    "QueryState": "RUNNING",
    "QuerySubmissionTime": 1723521767000,
    "QueryStartTime": 1723521767000,
    "QueryEndTime": 1723521767000,
    "Schema": "default",
    "Uid": 0,
    "DBClusterId": "amv-bp17s73f016****",
    "ResourceGroupName": "spark_rg",
    "Query": "SELECT * FROM db.tb",
    "Statements": [
      {
        "ResultUri": "oss://yourbucket/result.json",
        "EndTime": 1723521767000,
        "AppId": "s20240122jsdx****",
        "StatementId": "sq1723521767****-0001",
        "State": "RUNNING",
        "StartTime": 1723521767000,
        "Error": "table is not found",
        "Code": "SELECT 100",
        "Result": "+---+-----+\n|age| name|\n+---+-----+\n| 14|  Tom|\n| 23|Alice|\n+---+-----+"
      }
    ],
    "ErrMessage": "schema is not found"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Spark.SQL.NotFoundExecutableSQLErrorNo executable statements are submitted. Please check the input SQL.-
400Spark.SQL.NotFoundExecutableSQLErrorThe execution part is not included in the current submitted SQL, please check the input SQL.-
400Spark.SQL.BlankErrorInput sql can not be blank string.-
400Spark.InvalidParameterInvalid parameter value: %sIncorrect input parameter:%s.
400Spark.InvalidStateThe object of the operation is in an invalid state: %sThe operation object is invalid.
400Spark.InvalidStateThe object of the operation is in an invalid state: %s.The operand is in non-legal state %s.
404Spark.App.NotFoundThe Spark application %s is not found.-
404Spark.ObjectNotFoundThe object is not found. More information: %s-
500Spark.ServerErrorThe Spark control component system encountered an error, please create a ticket to solve the problem or concat the supported engineer on duty. Error message: %sAn error occurred on the Spark control component system. Submit a ticket or contact technical support.

For a list of error codes, visit the Service error codes.