cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

how to cancel or kill a long running sql query from databricks python notebook.I have a long running

slakshmanan
New Contributor III

how to cancel or kill a long running sql query from databricks python notebook.I have a long running sql query in sql warehouse

4 REPLIES 4

szymon_dybczak
Contributor III

Hi @slakshmanan ,

To stop or interrupt a running notebook, select the interrupt button in the notebook toolbar. You can also select Run > Interrupt execution, or use the keyboard shortcut I I.

https://learn.microsoft.com/en-us/azure/databricks/notebooks/run-notebook

And if you're going to use SQL warehouse then to terminate a long-running query started by you or another user:

  1. View query history.

  2. Click the name of a query.

  3. Next to Status, click Cancel.

https://docs.databricks.com/en/sql/user/queries/query-history.html#terminate-an-executing-query

Interrupt button looks like below:

szymon_dybczak_0-1728442814226.png

 

i want to stop it from rest api call or from an python code runnining in databricks to kill long running sql query from warehouse

I don't think that exist such an endpoint yet. At least, I couldn't find it in documentation.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group