All Products
Search
Document Center

AnalyticDB:CancelSparkWarehouseBatchSQL

Last Updated:Jul 01, 2026

Cancels a Spark SQL execution.

Operation description

  • Public endpoint of a region: adb.<region-id>.aliyuncs.com. Example: adb.ap-southeast-1.aliyuncs.com.

  • VPC endpoint of a region: adb-vpc.<region-id>.aliyuncs.com. Example: adb-vpc.ap-southeast-1.aliyuncs.com.

Note

If you encounter a 409 error when initiating requests from China North 1 (Qingdao), China South 1 (Shenzhen), China South 3 (Guangzhou), or Hong Kong (China), contact technical support.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

adb:CancelSparkWarehouseBatchSQL

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

QueryId

string

Yes

The execution ID of the Spark SQL.

sq202501011001s****

DBClusterId

string

No

The cluster ID.

amv-uf6485635f***

Agency

string

No

The client name for auxiliary recording. The value is a meaningful string of up to 16 characters.

DMS

Response elements

Element

Type

Description

Example

object

The response struct.

RequestId

string

The request ID.

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

Data SparkBatchSQL

The returned result.

123

Examples

Success response

JSON format

{
  "RequestId": "771C5FAA-530F-52F7-B84D-EBAD45***",
  "Data": {
    "Uid": 0,
    "QuerySubmissionTime": 1723521767000,
    "Query": "SELECT * FROM db.tb",
    "QueryId": "sq172352176****",
    "Schema": "default",
    "QueryEndTime": 1723521767000,
    "DBClusterId": "amv-bp17s73f016****",
    "QueryState": "RUNNING",
    "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",
    "QueryStartTime": 1723521767000,
    "ResourceGroupName": "spark_rg"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Spark.SQL.NotFoundExecutableSQLError No executable statements are submitted. Please check the input SQL. The SQL information in the Spark job does not contain executable statements.
400 Spark.SQL.BlankError Input sql can not be blank string. The submitted SQL statement cannot be empty.
400 Spark.InvalidParameter Invalid parameter value: %s Incorrect input parameter:%s.
400 Spark.InvalidState The object of the operation is in an invalid state: %s The operation object is invalid.
500 Spark.ServerError The Spark control component system encountered an error, please create a ticket to solve the problem or concat the supported engineer on duty. Error message: %s An error occurred on the Spark control component system. Submit a ticket or contact technical support.
404 Spark.App.NotFound The Spark application %s is not found. The specified Spark application was not found.
404 Spark.ObjectNotFound The object is not found. More information: %s The target object does not exist. Associated information: %s.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.