Queries the status of a specified code block.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetSparkStatement |
The operation that you want to perform. Set the value to GetSparkStatement. |
JobId | String | Yes | j202106071620hangzhou00000000001 |
The unique ID of the Spark job. |
StatementId | Integer | Yes | 1 |
The unique ID of the code block in the Spark job. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Data | Struct |
The status of the code block. |
|
Code | String | print(2+2) |
The code block submitted. |
CompletedTime | Long | 1623033200754 |
The timestamp when the execution of the code block is completed. |
Id | Integer | 1 |
The unique ID of the code block in the Spark job. The IDs increment sequentially. |
Output | String | "{\"status\":\"ok\",\"execution_count\":1,\"data\":{\"text/plain\":\"4\"}}" |
The execution result of the code block. It is a JSON string in the following format:
|
Process | Float | 0.5 |
The current execution progress. It is a floating-point number, which represents the
progress percentage. The value |
StartedTime | Long | 1623033200750 |
The timestamp when the code block started to execute, in milliseconds. |
State | String | running |
The status of the code block. Valid values:
|
RequestId | String | C5DB60E0-6EB3-493C-8956-DA0D3A2EE656 |
The unique ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=GetSparkStatement
&JobId=j202106071620hangzhou00000000001
&StatementId=1
&<Common request parameters>
Sample success responses
XML
format
<RequestId>C5DB60E0-6EB3-493C-8956-DA0D3A2EE656</RequestId>
<Data>
<CompletedTime>1623033200754</CompletedTime>
<State>available</State>
<Output>{"status":"ok","execution_count":1,"data":{"text/plain":"4"}}</Output>
<StartedTime>1623033200753</StartedTime>
<Process>1</Process>
<Id>1</Id>
<Code>print(2 + 2)
</Code>
</Data>
JSON
format
{
"RequestId": "C5DB60E0-6EB3-493C-8956-DA0D3A2EE656",
"Data": {
"CompletedTime": 1623033200754,
"State": "available",
"Output": "{\"status\":\"ok\",\"execution_count\":1,\"data\":{\"text/plain\":\"4\"}}",
"StartedTime": 1623033200753,
"Process": 1,
"Id": 1,
"Code": "print(2 + 2)\n"
}
}
Error codes
For a list of error codes, visit the API Error Center.