// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements.  See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License.  You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
= Operational Commands

== KILL QUERY

Cancels a running query. When a query is canceled with the `KILL` command, all parts of the query running on all other nodes are canceled too.

[.diagram-container]
Diagram(
Terminal('KILL'),
Terminal('QUERY'),
NonTerminal('query_id'),
Optional(Terminal('NO WAIT'))
)

=== Parameters

* `query_id` - query identifier that can be retrieved via the `SQL_QUERIES` link:administrators-guide/metrics/system-views[system view].
* `NO WAIT` - if specified, the command will return control immediately, without waiting for the query to be cancelled. You can monitor query status through the `SQL_QUERIES` link:administrators-guide/metrics/system-views[system view] to make sure it was cancelled.

== KILL TRANSACTION

Cancels an active transaction.

[.diagram-container]
Diagram(
Terminal('KILL'),
Terminal('TRANSACTION'),
NonTerminal('transaction_id'),
Optional(Terminal('NO WAIT'))
)

=== Parameters

* `transaction_id` - transaction identifier that can be retrieved via the `TRANSACTIONS` link:administrators-guide/metrics/system-views[system view].
* `NO WAIT` - if specified, the command will return control immediately, without waiting for the query to be cancelled. You can monitor transaction status through the `TRANSACTIONS` link:administrators-guide/metrics/system-views[system view] to make sure it was cancelled.

== KILL COMPUTE

Cancels a running query. When a query is canceled with the `KILL` command, all parts of the query running on all other nodes are canceled too.

[.diagram-container]
Diagram(
Terminal('KILL'),
Terminal('COMPUTE'),
NonTerminal('job_id'),
Optional(Terminal('NO WAIT'))
)

=== Parameters

* `job_id` - query identifier that can be retrieved via the `COMPUTE_JOBS` link:administrators-guide/metrics/system-views[system view].
* `NO WAIT` - if specified, the command will return control immediately, without waiting for the query to be cancelled. You can monitor job status through the `COMPUTE_JOBS` link:administrators-guide/metrics/system-views[system view] to make sure it was cancelled.