AnsweredAssumed Answered

Map Reduce - Input from HBase Tables

Question asked by rthimmana on Apr 25, 2013
Latest reply on Apr 27, 2013 by Ted Dunning
Scan
----
We want to scan a HBase table for various versions of the cell value - based on timestamp range or number of versions or ALL versions.

The code below is only returning the last version of the cell value. What should be done to get ALL the versions. We also tried scan.setMaxVersions(Integer.MAX_VALUE), still no success. Please advise !
  
Scan scan = new Scan();

scan.setMaxVersions();


if (column != null) {

   byte[ ][ ] colKey = KeyValue.parseColumn(Bytes.toBytes(column));

   scan.addColumn(colKey[0], colKey[1]);

}


Job job = new Job(conf, "Balance Updater: " + table + " " + column);

job.setJarByClass(BalanceUpdater.class);

TableMapReduceUtil.initTableMapperJob(table, scan, BalanceMapper.class, Text.class, DoubleWritable.class, job);

job.setReducerClass(BalanceReducer.class);

FileOutputFormat.setOutputPath(job, new Path(output));

System.exit(job.waitForCompletion(true) ? 0 : 1);

<br/>

Regards

Ramesh

Outcomes