filter - hbase search between composite keys - java -
in h base row key of form string+date e.g : abc+01/03/2012
searching based on 3 parameters (string,date,date) :
1.) first parameter string should match row key before + sign, have got
filter rowfilter=new rowfilter(compareop.equal, new binaryprefixcomparator(bytes.tobytes(ticker)));
because searching prefix, if search "ab", results "ab" , "abc", condition getting exact match?
2.) second parameter date should > row key date extracted row key abc+01/03/2012.
3.) third parameter date should < row key date extracted row key abc+01/03/2012.
basically dates should fall between provided dates only.
what possible solution this? thnx
try use scan setting start row , stop row, so, set start row= string+timestamp_1, stop row = string+timestamp_2.
if need find row 'string*'+ts, need write own datepostfixcomparator(startts, endts).
the second case slower first.
Comments
Post a Comment