You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jonathan Bishop <jb...@gmail.com> on 2012/10/31 22:49:14 UTC

SingleColumnValueFilter for empty column qualifier

Hi,

I am trying to use SingleColumnValueFilter to find only those rows which
have a particular column which is empty. Not sure what to use for the value
(4th arg in const). It does not take null, and I tried something like...

byte[] v = new byte[0];

but that does not seem to work.

Thanks,

Jon

Re: SingleColumnValueFilter for empty column qualifier

Posted by Jonathan Bishop <jb...@gmail.com>.
Hi,

Thanks for the help.

I am going forward with writing my own filter - but having some trouble
running it. What I did was simply copied SingleValueColumnFilter, renamed
it, and ran. But I got...

Exception in thread "main"
org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after
attempts=10, exceptions:
Thu Nov 01 11:18:29 PDT 2012,
org.apache.hadoop.hbase.client.ScannerCallable@2be2befa,
java.io.IOException: IPC server unable to read call parameters: Error in
readFields
Thu Nov 01 11:18:30 PDT 2012,
org.apache.hadoop.hbase.client.ScannerCallable@2be2befa,
java.io.IOException: IPC server unable to read call parameters: Error in
readFields
Thu Nov 01 11:18:31 PDT 2012,
org.apache.hadoop.hbase.client.ScannerCallable@2be2befa,
java.io.IOException: IPC server unable to read call parameters: Error in
readFields

Here is how I run it...

java -cp Graph/bin:$HADOOP_CLASSPATH test

This runs fine when I use SingleColumnValueFilter, but I get the above
error messages when I use my copy of that class. Maybe I am not running
this correctly?

Thanks,

Jon


On Wed, Oct 31, 2012 at 11:38 PM, Anoop John <an...@gmail.com> wrote:

> You have one CF such that all rows will have KVs for that CF?
> You need to implement your own filter.
> Your scan can select the above CF and the on which u need the filtering.
> Have a look at the QualifierFilter.. similar approach you might need to do
> in the new filter..  Good luck :)
>
> -Anoop-
>
> On Thu, Nov 1, 2012 at 8:08 AM, anil gupta <an...@gmail.com> wrote:
>
> > Hi Jonathan,
> >
> > Then in that case SingleColumnValueFilter will not work.
> > SingleColumnValueFilter works on the value of a cell rather than
> > ColumnQualifier name.
> > I have never heard of a built-in filter in HBase which can give you are
> all
> > rows  where a certain column family does not have any column qualifier.
> >
> > You can have a look at QualifierFilter:
> >
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/QualifierFilter.html
> > .
> > If QualifierFilter does suffices then you might have to implement by your
> > own.
> >
> > HTH,
> > Anil
> >
> > On Wed, Oct 31, 2012 at 4:07 PM, Jonathan Bishop <jbishop.rwc@gmail.com
> > >wrote:
> >
> > > When I created the table I created column families, one of which is say
> > > "xyz".
> > >
> > > Now I would like to find all rows for which "xyz" is empty - in other
> > words
> > > no puts were made to that column family for that row.
> > >
> > > My column qualifiers are all "".
> > >
> > >
> > > On Wed, Oct 31, 2012 at 3:22 PM, anil gupta <an...@gmail.com>
> > wrote:
> > >
> > > > Hi Jonathan,
> > > >
> > > > Do you mean that cell value is ""? or column qualifier is ""? I am
> > > confused
> > > > by your description.
> > > > If you were talking about cell value, at the time of put which object
> > do
> > > > you use for cell value? String?
> > > >
> > > > Thanks,
> > > > Anil
> > > >
> > > > On Wed, Oct 31, 2012 at 2:49 PM, Jonathan Bishop <
> > jbishop.rwc@gmail.com
> > > > >wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I am trying to use SingleColumnValueFilter to find only those rows
> > > which
> > > > > have a particular column which is empty. Not sure what to use for
> the
> > > > value
> > > > > (4th arg in const). It does not take null, and I tried something
> > > like...
> > > > >
> > > > > byte[] v = new byte[0];
> > > > >
> > > > > but that does not seem to work.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Jon
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks & Regards,
> > > > Anil Gupta
> > > >
> > >
> >
> >
> >
> > --
> > Thanks & Regards,
> > Anil Gupta
> >
>

Re: SingleColumnValueFilter for empty column qualifier

Posted by Anoop John <an...@gmail.com>.
You have one CF such that all rows will have KVs for that CF?
You need to implement your own filter.
Your scan can select the above CF and the on which u need the filtering.
Have a look at the QualifierFilter.. similar approach you might need to do
in the new filter..  Good luck :)

-Anoop-

On Thu, Nov 1, 2012 at 8:08 AM, anil gupta <an...@gmail.com> wrote:

> Hi Jonathan,
>
> Then in that case SingleColumnValueFilter will not work.
> SingleColumnValueFilter works on the value of a cell rather than
> ColumnQualifier name.
> I have never heard of a built-in filter in HBase which can give you are all
> rows  where a certain column family does not have any column qualifier.
>
> You can have a look at QualifierFilter:
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/QualifierFilter.html
> .
> If QualifierFilter does suffices then you might have to implement by your
> own.
>
> HTH,
> Anil
>
> On Wed, Oct 31, 2012 at 4:07 PM, Jonathan Bishop <jbishop.rwc@gmail.com
> >wrote:
>
> > When I created the table I created column families, one of which is say
> > "xyz".
> >
> > Now I would like to find all rows for which "xyz" is empty - in other
> words
> > no puts were made to that column family for that row.
> >
> > My column qualifiers are all "".
> >
> >
> > On Wed, Oct 31, 2012 at 3:22 PM, anil gupta <an...@gmail.com>
> wrote:
> >
> > > Hi Jonathan,
> > >
> > > Do you mean that cell value is ""? or column qualifier is ""? I am
> > confused
> > > by your description.
> > > If you were talking about cell value, at the time of put which object
> do
> > > you use for cell value? String?
> > >
> > > Thanks,
> > > Anil
> > >
> > > On Wed, Oct 31, 2012 at 2:49 PM, Jonathan Bishop <
> jbishop.rwc@gmail.com
> > > >wrote:
> > >
> > > > Hi,
> > > >
> > > > I am trying to use SingleColumnValueFilter to find only those rows
> > which
> > > > have a particular column which is empty. Not sure what to use for the
> > > value
> > > > (4th arg in const). It does not take null, and I tried something
> > like...
> > > >
> > > > byte[] v = new byte[0];
> > > >
> > > > but that does not seem to work.
> > > >
> > > > Thanks,
> > > >
> > > > Jon
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks & Regards,
> > > Anil Gupta
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>

Re: SingleColumnValueFilter for empty column qualifier

Posted by anil gupta <an...@gmail.com>.
Hi Jonathan,

Then in that case SingleColumnValueFilter will not work.
SingleColumnValueFilter works on the value of a cell rather than
ColumnQualifier name.
I have never heard of a built-in filter in HBase which can give you are all
rows  where a certain column family does not have any column qualifier.

You can have a look at QualifierFilter:
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/QualifierFilter.html.
If QualifierFilter does suffices then you might have to implement by your
own.

HTH,
Anil

On Wed, Oct 31, 2012 at 4:07 PM, Jonathan Bishop <jb...@gmail.com>wrote:

> When I created the table I created column families, one of which is say
> "xyz".
>
> Now I would like to find all rows for which "xyz" is empty - in other words
> no puts were made to that column family for that row.
>
> My column qualifiers are all "".
>
>
> On Wed, Oct 31, 2012 at 3:22 PM, anil gupta <an...@gmail.com> wrote:
>
> > Hi Jonathan,
> >
> > Do you mean that cell value is ""? or column qualifier is ""? I am
> confused
> > by your description.
> > If you were talking about cell value, at the time of put which object do
> > you use for cell value? String?
> >
> > Thanks,
> > Anil
> >
> > On Wed, Oct 31, 2012 at 2:49 PM, Jonathan Bishop <jbishop.rwc@gmail.com
> > >wrote:
> >
> > > Hi,
> > >
> > > I am trying to use SingleColumnValueFilter to find only those rows
> which
> > > have a particular column which is empty. Not sure what to use for the
> > value
> > > (4th arg in const). It does not take null, and I tried something
> like...
> > >
> > > byte[] v = new byte[0];
> > >
> > > but that does not seem to work.
> > >
> > > Thanks,
> > >
> > > Jon
> > >
> >
> >
> >
> > --
> > Thanks & Regards,
> > Anil Gupta
> >
>



-- 
Thanks & Regards,
Anil Gupta

Re: SingleColumnValueFilter for empty column qualifier

Posted by Jonathan Bishop <jb...@gmail.com>.
When I created the table I created column families, one of which is say
"xyz".

Now I would like to find all rows for which "xyz" is empty - in other words
no puts were made to that column family for that row.

My column qualifiers are all "".


On Wed, Oct 31, 2012 at 3:22 PM, anil gupta <an...@gmail.com> wrote:

> Hi Jonathan,
>
> Do you mean that cell value is ""? or column qualifier is ""? I am confused
> by your description.
> If you were talking about cell value, at the time of put which object do
> you use for cell value? String?
>
> Thanks,
> Anil
>
> On Wed, Oct 31, 2012 at 2:49 PM, Jonathan Bishop <jbishop.rwc@gmail.com
> >wrote:
>
> > Hi,
> >
> > I am trying to use SingleColumnValueFilter to find only those rows which
> > have a particular column which is empty. Not sure what to use for the
> value
> > (4th arg in const). It does not take null, and I tried something like...
> >
> > byte[] v = new byte[0];
> >
> > but that does not seem to work.
> >
> > Thanks,
> >
> > Jon
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>

Re: SingleColumnValueFilter for empty column qualifier

Posted by anil gupta <an...@gmail.com>.
Hi Jonathan,

Do you mean that cell value is ""? or column qualifier is ""? I am confused
by your description.
If you were talking about cell value, at the time of put which object do
you use for cell value? String?

Thanks,
Anil

On Wed, Oct 31, 2012 at 2:49 PM, Jonathan Bishop <jb...@gmail.com>wrote:

> Hi,
>
> I am trying to use SingleColumnValueFilter to find only those rows which
> have a particular column which is empty. Not sure what to use for the value
> (4th arg in const). It does not take null, and I tried something like...
>
> byte[] v = new byte[0];
>
> but that does not seem to work.
>
> Thanks,
>
> Jon
>



-- 
Thanks & Regards,
Anil Gupta