Hi Fleming,
There are examples in the test code:
http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/indexed/src/test/org/apache/hadoop/hbase/regionserver/TestIdxRegion.java?view=markup

<http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/indexed/src/test/org/apache/hadoop/hbase/regionserver/TestIdxRegion.java?view=markup>Here's
a snippet:

> IdxScan idxScan = new IdxScan();
> idxScan.addFamily(Bytes.toBytes("family"));
> idxScan.setExpression(Comparison.comparison(family, qualLong,
>   Comparison.Operator.GTE, Bytes.toBytes(50L)));
>
> You also need to provide a filter that (at least) matches your index
expression hint.  In your example and the one I've posted above the
SingleColumnValueFilter would be fine...

Could you elaborate a bit more on the results you are seeing?  Is the scan
returning more results than you expect?  Is it not returning any results?

Also, don't you need to specify the families/columns you want to return in
the scan (see example code above)?  I'm not 100% sure on that but I've
always done it...

Cheers,
Dan

2010/3/15 <y_823...@tsmc.com>

> Hi,
>
> Anyone has IdxScan sample?
>
> The result from following code snip can not get the right value. Thanks!
>
> IdxScan scan = new IdxScan();
> scan.setExpression(Expression.comparison(Bytes.toBytes("MyColumnFamily"),
> Bytes.toBytes("MyQualifier"),
>                  Comparison.Operator.EQ, Bytes.toBytes("myValue")));
>
>
>
>
> Fleming Chiu(邱宏明)
> 707-6128
> y_823...@tsmc.com
> 週一無肉日吃素救地球(Meat Free Monday Taiwan)
>
>
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>
>  ---------------------------------------------------------------------------
>
>
>
>

Reply via email to