Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Hbase filter with column and value.


Copy link to this message
-
Re: Hbase filter with column and value.
Hey Davis You can try this Get a full row using row key which you can get
using creating a scanner like follow :

Scan sc=new scan();
Resultscanner rss= hTable.getscanner(sc);
for(Result r:rss)
rowkey=r.getrow();

then using this rowkey you can create a Get  as
Get g=new get(rowkey);
then
g.*addFamily()*
Get all columns from the specified family.
Hope you know the column family already right? that is fixed right?

or else you can try :
Scan s =new scan();

Filter f = new ColumnRangeFilter(Bytes.toBytes(" foo_1 "), true,
                     Bytes.toBytes(" foo_n"), false);

s.setFilter(f);
ResultScanner rs = t.getScanner(s);

this you can use as result. will give you the columns.
also you can give a try to

Class HTableDescriptor

and also :

The only way to get a complete set of columns that exist for a ColumnFamily
is to process all the rows. For more information about how HBase stores
data internally, seeSection 8.7.5.4,
“KeyValue”<http://hbase.apache.org/book.html#keyvalue>
.

Hope some how it will help you..

Shashwat Shriparv
On Thu, Apr 26, 2012 at 11:26 PM, Davis <[EMAIL PROTECTED]> wrote:

> Hi Jieshan
>   Thanks a lot for the reply.
> BUT in this case i don't have the column name since im using
> ColumnPrefixFilter.
> Is there a way get the result without adding the particular column and
> column
> family name to scanner object??
>
>
>
--