Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to import data in HBase using mapreduce?

  • Sample code Segment

    //HBase mapper
    //Input table passed as pair to Mapper
    map(ImmutableBytesWritable rowKey, Result columns, Context context)
    //Write output of mapper as pair
    context.write(key1,value1);

  • Command

    //HBase Reducer
    //Reducer access of key-value pair from mapper output
    reduce(Text key1, Iterable value1, Context context)
    for each(IntWritable s:values1)
    sum+=s
    end for
    // Create HBase output table with rowkey
    Put outputable = new Put(key1);
    // Insert sum value to HBase output table
    outputable.add(columnfamily,column, sum);
    // Write data to HBase ouput table
    context.write(null, outputable);