When you run SQL, Spark, or MapReduce tasks that you submit in MaxCompute, the tasks are instantiated as instances. A task instance represents the lifecycle of the task from running to termination and includes the running information about the task, such as task ID, start time, end time, running status, and logs.
The lifecycle of task instances includes two stages: Running and Terminated.
Task instances that are in the Running stage are in the Running state. Task instances that are in the Terminated stage can be in the Success, Failed, or Cancelled state. You can query or change the status of a task instance based on the ID that MaxCompute assigns to the task instance. Examples:
-- Query the status of a task instance.
status instance_id;
-- Terminate a task instance. After you run the kill command, the status of the task instance changes to Cancelled.
kill instance_id;
-- View the operational logs of a task instance.
wait instance_id;
In the preceding commands, instance_id indicates the ID of the task instance that you want to manage. Replace this parameter with the actual instance ID.
References
For more information about instance operations, see Resource operations.