KILL QUERY statement

The KILL QUERY statement allows you to programmatically terminate running queries by specifying their query ids. This functionality helps manage workloads by enabling users to cancel and unregister queries across any coordinator in the cluster.

Syntax

You can kill one or more running queries using the following syntax:

KILL QUERY 'query_id';

Replace 'query_id' with the query id you want to terminate. For example:

KILL QUERY '123:456';

Query_id represents a query that is currently executing in the system.

Required privileges: Only administrators or query owners can execute KILL QUERY.

Cancellation: Cannot be cancelled.

Considerations: If the specified query is not found on any of the coordinators in the cluster, a Could not find query on any coordinator error is returned.