Stops a specified instance that is in the Running state.
Syntax
kill <instance_id>;
Note
- The execution of this statement is an asynchronous process. After the system accepts the request and returns a result, it does not mean that the distributed job has been stopped. Instead, it only means that the system has received the request. You must execute the
STATUS
statement to check the status of the instance. - After the
KILL
statement is executed, the system sets the task status toCancel
. Several checkpoints are configured during the SQL statement execution. The system checks whether the task status isCancel
at each checkpoint. If the task status isCancel
, the system performs the closing process.Checks are performed at the following time periods: task waiting, before and after the compiler is run, during optimization by the optimizer, before and after a physical query plan is generated, before and after a computing task is submitted, before and after metadata is updated, and before and after execution result statistics are performed.
Parameters
instance_id: the ID of an instance. Each instance ID is unique. Only an instance in the Running state can be specified. Otherwise, an error is returned.
Examples
-- Stop the instance whose ID is 20131225123xxxxxxxxxxxxxxx.
kill 20131225123xxxxxxxxxxxxxxx;
Related statements
- SHOW: Views the information about an instance. The information includes StartTime (accurate to the second), RunTime (in seconds), Status, InstanceID, Owner, and Query statements.
- STATUS: Views the status of the specified instance.
- TOP INSTANCE: Views the information about instances that are running in a project.
- DESC INSTANCE: Obtains job information based on a specified instance ID. The information includes SQL, Owner, StartTime, EndTime, and Status.
- WAIT: Obtains the run log of jobs based on a specified instance ID. The log includes the Logview URLs of jobs.