MaxCompute Lightning provides a system view stv_recents. By querying the view, you can view all query tasks that the current user is running.

View running queries

You can execute the query command to view the related information, including query ID, user name, query SQL statement, start time, duration, and waiting resources. Note: The "t" indicates that a query task has not been executed yet and is waiting for resources. The "f" indicates that the resources are being acquired and that the query task is being executed.

Run the following query command.
select * from stv_recents;
The following figure shows a command output example.

Cancel running queries

You can obtain information on running queries by querying the stv_recents table. To cancel a running query, execute the following query command.
select cancel('query_id');
In parentheses is the query_id of a running query.