hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lars hofhansl <la...@apache.org>
Subject Re: single column value filter to find rows greater than a certain date not working
Date Fri, 03 Oct 2014 19:36:10 GMT
> Bytes.toBytes("20110810")

Is that exactly how you are storing the dates? As string converted to bytes? Or did you store
them as a long converted to bytes?

Also note that this is a fairly inefficient way if doing this. If this is the typical access
pattern you should put the data in the row key and use Scan.{start|stop}Row to filter.


-- Lars



________________________________
 From: aaaa342156 <karunk825@outlook.com>
To: user@hbase.apache.org 
Sent: Friday, October 3, 2014 4:35 AM
Subject: single column value filter to find rows greater than a certain date not working
 

I am storing date in a column in Hbase table. I am using below syntax to find
dates greater than 20110810 but the resultset is bringing back all the rows.
Any thoughts.

Filter filter = new SingleColumnValueFilter(Bytes.toBytes("cf"),
Bytes.toBytes("d"), CompareOp.GREATER_OR_EQUAL, Bytes.toBytes("20110810"));
scan.setFilter(filter);
ResultScanner rs = table.getScanner(scan);



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/single-column-value-filter-to-find-rows-greater-than-a-certain-date-not-working-tp4064684.html
Sent from the HBase User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message