The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

MapReduce Forum

MapReduce Error when i run mapreduce program.

  • #46173
    Anupam Gupta

    Dear All

    I am facing the below error . when i run mapreduce java code for analysis of my document .I have mapreduce code compiled successful and i have made jar file also.i am firing this command.
    “hadoop jar hospital.jar edu.osu.cse.ysmart.testquery1000 /user/hue/input /user/hue/output ”

    i have write the mapreduce java code for query(Select sum( column_name) from hospital where columnname=values;

    Error code are :

    13/12/24 08:25:15 INFO mapred.JobClient: map 0% reduce 0%
    13/12/24 08:25:32 INFO mapred.JobClient: Task Id : attempt_201312240604_0010_m_000000_0, Status : FAILED
    at edu.osu.cse.ysmart.testquery1000$
    at edu.osu.cse.ysmart.testquery1000$
    at org.apache.hadoop.mapred.MapTask.runNewMapper(
    at org.apache.hadoop.mapred.Child$
    at Method)
    at org.apache.hadoop.mapred.Child.main(

    i am waiting for your valuable response.

  • Author
  • #46292
    Anupam Gupta

    Hi All,

    This is our Program for whic we are getting above error……..

    package edu.osu.cse.ysmart.TestQuery;
    import java.util.*;
    import java.text.*;
    import org.apache.hadoop.fs.Path;
    import org.apache.hadoop.conf.*;
    import org.apache.hadoop.util.Tool;
    import org.apache.hadoop.util.ToolRunner;
    import org.apache.hadoop.mapreduce.Job;
    import org.apache.hadoop.mapreduce.Mapper;
    import org.apache.hadoop.mapreduce.Reducer;
    import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
    import org.apache.hadoop.mapreduce.lib.input.FileSplit;
    import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
    import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
    import org.apache.hadoop.mapreduce.lib.partition.*;

    public class TestQuery1 extends Configured implements Tool{

    public static class Map extends Mapper<Object, Text,NullWritable,Text>{

    public void map(Object key, Text value, Context context) throws IOException,InterruptedException{

    String line = value.toString();
    String[] line_buf = new String[3];
    int prev=0,i=0,n=0;

    if (line.charAt(i) == ‘|’){
    line_buf[n] = line.substring(prev,i);
    n = n+1;
    prev = i+1;
    if(n == 3)

    line_buf[n] = line.substring(prev,i);
    if(line_buf[2].compareTo(“Abid Khan”) == 0){

    NullWritable key_op = NullWritable.get();
    context.write(key_op , new Text(line_buf[1]+ “|” ));


    public int run(String[] args) throws Exception{

    Configuration conf = new Configuration();
    Job job = new Job(conf,”TestQuery1″);
    FileInputFormat.addInputPath(job, new Path(args[0]));
    FileOutputFormat.setOutputPath(job, new Path(args[1]));
    return (job.waitForCompletion(true) ? 0 : 1);

    public static void main(String[] args) throws Exception {

    int res = Configuration(), new TestQuery1(), args);


    Thanks in advance

    Aravind Yarram

    The exception is clear

    at edu.osu.cse.ysmart.testquery1000$

    Provide the line numbers to your code or attach the sample input file so that we can test and let you know.

The forum ‘MapReduce’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.