st789
st789

Reputation: 41

How to stop a Hive query without exiting Beeline CLI?

If I accidently start a long query, how can I stop it without exiting Beeline interface? When I use CTRL + Z and CTRL + C both stop the query but exit Beeline. Also, if I am typing a query and accidently make an typing error, is there a shortcut to delete query from start of the line and/or abandon query and start new line?

Upvotes: 2

Views: 314

Answers (1)

Koushik Roy
Koushik Roy

Reputation: 7387

You can do it, (Of course you need admin permission). Fire below command to see all job ids.
hadoop job -list

Then use the Job ID to kill.
hadoop job -kill <job_id>

Another alternative would be to kill the application using (if hive is using yarn) yarn application -kill <application_id>

If you are using cloudera, You can kill the SQL by using Cloudera manager (CDH). You can search by running queries and kill them from UI.

Upvotes: 1

Related Questions