[
https://issues.apache.org/jira/browse/HBASE-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286852#comment-13286852
]
Joep Rottinghuis commented on HBASE-6142:
-----------------------------------------
See the JavaDoc in SingleColumnValueFilter:
{code}
/**
* This filter is used to filter cells based on value. It takes a {@link
CompareFilter.CompareOp}
* operator (equal, greater, not equal, etc), and either a byte [] value or
* a WritableByteArrayComparable.
{code}
"to filter" is not clear. Filter in (pass), or filter out (like
Filter#filterRowKey)?
Then the following snippet seems to match how Filter is defined, but is not
actually how it does work:
{code}
* If we have a byte [] value then we just do a lexicographic compare. For
* example, if passed value is 'b' and cell has 'a' and the compare operator
* is LESS, then we will filter out this cell (return true). If this is not
* sufficient (eg you want to deserialize a long and then compare it to a fixed
* long value), then you can pass in your own comparator instead.
{code}
I think that is incorrect. In this example since 'a' _is_ LESS than 'b' the
value would actually pass the filter (row returned by scan).
> Javadoc in some Filters ambiguous
> ---------------------------------
>
> Key: HBASE-6142
> URL: https://issues.apache.org/jira/browse/HBASE-6142
> Project: HBase
> Issue Type: Bug
> Components: documentation
> Affects Versions: 0.92.2, 0.96.0, 0.94.1
> Reporter: Joep Rottinghuis
> Priority: Minor
>
> The javadoc on some of the filter is somewhat confusing.
> The main Filter interface has methods that behave like a sieve; when
> filterRowKey returns true, that means that the row is filtered _out_ (not
> included).
> Many of the Filter implementations work the other way around. When the
> condition is met the value passes (ie, the row is returned).
> Most Filters make it clear when a values passes (passing through the filter
> meaning the values are returned from the scan).
> Some are less clear in light of how the Filter interface works:
> WhileMatchFilter and SingleColumnValueFilter are examples.
--
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