Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop a particular job while running Hive queries on Hadoop?

Tags:

hadoop

hive

Scenario:

When I run enter the query on Hive CLI, I get the errors as below:

Query:

**$ bin/hive -e "insert overwrite table pokes select a.* from invites a where a.ds='2008-08-15';"** 

Error is like this:

Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Starting Job = job_201111291547_0013, Tracking URL = http://localhost:50030/jobdetails.jsp?jobid=job_201111291547_0013 Kill Command = C:\cygwin\home\Bhavesh.Shah\hadoop-0.20.2/bin/hadoop job -Dmapred.job.tracker=localhost:9101 -kill job_201111291547_0013 2011-12-01 14:00:52,380 Stage-1 map = 0%, reduce = 0% 2011-12-01 14:01:19,518 Stage-1 map = 100%, reduce = 100% Ended Job = job_201111291547_0013 with errors FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask

Question:

So my question is that how to stop a job? In this case the job is : job_201111291547_0013 Pls help me out so that I can remove these errors and try for next. Thanks.

like image 390
Bhavesh Shah Avatar asked Dec 02 '11 04:12

Bhavesh Shah


People also ask

What happens when a Hive query is submitted?

The user interacts with the Hive through the user interface by submitting Hive queries. The driver passes the Hive query to the compiler. The compiler generates the execution plan. The Execution engine executes the plan.

What happens when a Hive query is executed?

So execution engine sends the DAG to Hadoop cluster, where its actually gets executed and the results again sends back to the execution engine. Those results, execution engines sends back to the driver and driver finally sends back to the client program. This is how Hive communication happens.


2 Answers

You can stop a job by running hadoop job -kill <job_id>.

like image 101
alexlod Avatar answered Sep 24 '22 06:09

alexlod


hadoop job -kill is deprecated now. Use mapred job -kill instead.

like image 24
Outlier Avatar answered Sep 23 '22 06:09

Outlier