How to Read Multiple Table Simultaneously in HBase Mapreduce

  • Sample code Segment

    //Create ArrayList
    List table = new ArrayList();

    //Store the first input table
    Scan table1 = new Scan();
    table1.setAttribute("", Bytes.toBytes("tablename1"));

    //Store the second input table
    Scan table2= new Scan();
    table2.setAttribute("", Bytes.toBytes("tablename2"));

    //Access mutiple input tables
    TableMapReduceUtil.initTableMapperJob(table, mapper.class, mapper.class, job); //input tables
    TableMapReduceUtil.initTableReducerJob( "outputtable", reducer.class, job); //output tables