You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Peter Haidinyak <ph...@local.com> on 2011/01/26 00:11:45 UTC

Scan and addColumn and Filters

Hi All,
   I finally figured out what was happening with my scans not bringing back any results when using some filters. It turns out if I don't add the column, via scan.addColumn(), for the column I am filtering for the scan will not return data. I was trying to reduce the amount of data being returned from a scan so I didn't add any columns I didn't need for display, they are just used to filter results.
	Is this an expected result? The javadocs didn't mention anything about it (that I could find).

Thanks

-Pete

Re: Scan and addColumn and Filters

Posted by Ryan Rawson <ry...@gmail.com>.
This is the expected result (un)fortunately.

It isn't javadoced at the top level, but deep inside you can find:

http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.html

where it says:

"When using this filter on a Scan with specified inputs, the column to
be tested should also be added as input (otherwise the filter will
regard the column as missing). "

Which is a little cryptic, but more helpful than nothing.

I just opened:  https://issues.apache.org/jira/browse/HBASE-3479 If
you'd like to contribute.

-ryan


On Tue, Jan 25, 2011 at 3:11 PM, Peter Haidinyak <ph...@local.com> wrote:
> Hi All,
>   I finally figured out what was happening with my scans not bringing back any results when using some filters. It turns out if I don't add the column, via scan.addColumn(), for the column I am filtering for the scan will not return data. I was trying to reduce the amount of data being returned from a scan so I didn't add any columns I didn't need for display, they are just used to filter results.
>        Is this an expected result? The javadocs didn't mention anything about it (that I could find).
>
> Thanks
>
> -Pete
>