My hbase table looks like this:
hbase(main):040:0> scan 'TEST'
ROW COLUMN+CELL
4 column=data:108, timestamp=1399972960190, value=-240.0
4 column=data:112, timestamp=1399972960138, value=-160.0
4 column=data:12, timestamp=1399972922979, value=2
4 column=data:120, timestamp=1399972960124, value=-152.0
4 column=data:144, timestamp=1399972960171, value=-240.0
4 column=data:148, timestamp=1399972960152, value=-240.0
4 column=data:16, timestamp=1399972909606, value=9
4 column=data:8, timestamp=1399972917978, value=6
where all 4s are row id and 108,112,12... are qualifiers. I want to fetch random three qualifiers from this table TEST.
I can fetch all qualifiers but not random three qualifiers. Is there any shell command or API in java through which I can achieve this?
If it is about just getting the first three rows use scan shell command with LIMIT set to 3:
If you wish to do it using Java API, set a loop over ResultScanner which breaks after the third iteration. Simple and easy.
And if you wish to get 3 random rows, use RandomRowFilter with the above approach.
HTH