hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haosdent <haosd...@gmail.com>
Subject Re: how to use SingleColumnValueFilter
Date Fri, 11 Oct 2013 10:31:39 GMT
CompareFilter.CompareOp.GREATER is based on number comparison when the type of field is double.


-- 
Best Regards,
Haosong Huang


On Friday, October 11, 2013 at 4:22 PM, kun yan wrote:

> Hi all
> This is part of my hbase code, I want to query longitude greater than 144,
> but I can not get the correct results
> My question is whether the comparison is based on dictionary order. If I
> want to filter it based on a comparison of type double what to do, that is,
> the numerical comparison
> 
> thanks a lot
> 
> HTablePool pool = new HTablePool();
> HTableInterface table = pool.getTable(data_rh);
> SingleColumnValueFilter filter1 = new SingleColumnValueFilter(
> Bytes.toBytes("s"), Bytes.toBytes("LONGITUDE"),
> CompareFilter.CompareOp.GREATER,
> Bytes.toBytes(LONGTIUDE_DOUBLE));
> Scan scan = new Scan();
> scan.addColumn(Bytes.toBytes("s"), Bytes.toBytes("LONGITUDE"));
> scan.setFilter(filter1);
> -- 
> 
> In the Hadoop world, I am just a novice, explore the entire Hadoop
> ecosystem, I hope one day I can contribute their own code
> 
> YanBit
> yankunhadoop@gmail.com (mailto:yankunhadoop@gmail.com)
> 
> 



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message