[
https://issues.apache.org/jira/browse/HBASE-4364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436485#comment-13436485
]
Jie Huang commented on HBASE-4364:
----------------------------------
Actually, I know we can use SingleColumnValueExcludeFilter to solve the problem
somehow. That is why I said this is not a bug before. The document already
hints to include both "required" and "criteria" columns altogether. Otherwise,
the criteria column will be regarded as missing part in the filter. The correct
way is:
{noformat}
scan 't2', { COLUMNS => ['f:e_word', 'f:f_word'], FILTER =>
"SingleColumnValueExcludeFilter('f', 'f_word', >, 'binary:b')" }
{noformat}
But, SingleColumnValueExcludeFilter only helps to not return that filter's
"criteria column". We still need to specify both "e_word" and "f_word" columns
in the "required" list. Otherwise, we still get the wrong result like this:
{noformat}
scan 't2', { COLUMNS => ['f:e_word'], FILTER =>
"SingleColumnValueExcludeFilter('f', 'f_word', >, 'binary:b')" }
ROW COLUMN+CELL
r1 column=f:e_word, timestamp=1345084564838,
value=hello
r2 column=f:e_word, timestamp=1345084564895,
value=goodbye
{noformat}
The points of that proposal in the patch file are :
# *select A from table where B>'b'* is more acceptable by SQL user rather than
*select A exclusively (B) from table where B>'b'*
# To add one chance to combine "required" and "criteria" columns before doing
the filtering work, which may be used by other filter later. It is not only for
SingleColumnValueFilter.
For the other problem in the unit-test, shall we create a new issue and have
further discussion there?
> Filters applied to columns not in the selected column list are ignored
> ----------------------------------------------------------------------
>
> Key: HBASE-4364
> URL: https://issues.apache.org/jira/browse/HBASE-4364
> Project: HBase
> Issue Type: Bug
> Components: filters
> Affects Versions: 0.90.4, 0.92.0, 0.94.0
> Reporter: Todd Lipcon
> Priority: Critical
> Attachments:
> HBASE-4364-failing-test-with-simplest-custom-filter.patch,
> hbase-4364_trunk.patch, hbase-4364_trunk-v2.patch
>
>
> For a scan, if you select some set of columns using addColumns(), and then
> apply a SingleColumnValueFilter that restricts the results based on some
> other columns which aren't selected, then those filter conditions are ignored.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira