Padmanabhan Vijendran
Padmanabhan Vijendran

Reputation: 306

Kill hive queries without exiting from hive shell

Is there any way we can kill hive query without exiting from hive shell ?. For Example, I wrongly ran the select statement from some table which has million rows of data, i just wanted to stop it, but not exiting from the shell. If I pressed CTRL+Z, its coming out of shell.

Upvotes: 7

Views: 25137

Answers (3)

leftjoin
leftjoin

Reputation: 38335

You have two options:

  1. press Ctrl+C and wait till command terminates, it will not exit from hive CLI, press Ctrl+C second time and the session will terminate immediately exiting to the shell

  2. from another shell run

    yarn application -kill <Application ID> or mapred job -kill <JOB_ID>

Upvotes: 8

ravi
ravi

Reputation: 15

Go with the second option

yarn application -kill <Application ID>. Get the application ID by getting onto another session. This is the only way I think you would be able to kill the current query. I do use via beeline on hortonwork framework.

Upvotes: 1

Hrabosch
Hrabosch

Reputation: 1583

First, look for Job ID by:

hadoop job -list

And then kill it by ID:

hadoop job -kill <JOB_ID>

Upvotes: 2

Related Questions