Scan Hbase for particular rowkey's -
i want columns hbase table within particular rowkey.
eg: rowkey starts 123456 rowkey ends 123466 want fetch programatically (in java) columns within rowkeym only.
this quite straight forward. have tried anything? anyways,
configuration conf = hbaseconfiguration.create(); htable table = new htable(conf, "tablename"); scan scan = new scan(); scan.setstartrow(bytes.tobytes("123456")); scan.setstoprow(bytes.tobytes("123456")); resultscanner rs = table.getscanner(); (result result : scanner) { (keyvalue kv : result.raw()) { system.out.println("kv: " + kv + ", value: " + bytes.tostring(kv.getvalue())); } } scanner.close();
Comments
Post a Comment