You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Reid Chan (JIRA)" <ji...@apache.org> on 2018/01/23 04:19:00 UTC

[jira] [Commented] (HBASE-19824) SingleColumnValueFilter returns wrong result when used in shell command

    [ https://issues.apache.org/jira/browse/HBASE-19824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335371#comment-16335371 ] 

Reid Chan commented on HBASE-19824:
-----------------------------------

There're bugs in {{SingleColumnValueFilter}} 
{code}
  @Override
  public ReturnCode filterCell(final Cell c) {
    // System.out.println("REMOVE KEY=" + keyValue.toString() + ", value=" + Bytes.toString(keyValue.getValue()));
    if (this.matchedColumn) {
      // We already found and matched the single column, all keys now pass
      return ReturnCode.INCLUDE;
    } else if (this.latestVersionOnly && this.foundColumn) {
      // We found but did not match the single column, skip to next row
      return ReturnCode.NEXT_ROW;
    }
{code}
this snippet will lead to the phenomenon as Ted described. Since f1:a1:a2 matched, {{matchedColumn}} is set **true**, the following f1:b1:b2 will be kept anyway.

Also, in the same method
{code}
  @Override
  public ReturnCode filterCell(final Cell c) {
    ...
    if (!CellUtil.matchingColumn(c, this.columnFamily, this.columnQualifier)) {
      return ReturnCode.INCLUDE;
    }
{code}
this snippet will lead to even a mismatch column will be kept.

Correct me if i'm wrong.

> SingleColumnValueFilter returns wrong result when used in shell command
> -----------------------------------------------------------------------
>
>                 Key: HBASE-19824
>                 URL: https://issues.apache.org/jira/browse/HBASE-19824
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0-alpha-4
>            Reporter: Ted Yu
>            Assignee: Reid Chan
>            Priority: Major
>
> There are two cells in table t1:
> {code}
> ROW                                                         COLUMN+CELL
>  r1                                                         column=f1:a1, timestamp=1516313683984, value=a2
>  r1                                                         column=f1:b1, timestamp=1516313700744, value=b2
> {code}
> When SingleColumnValueFilter is used in shell command, no filtering was done:
> {code}
> hbase(main):022:0> scan 't1', {FILTER => "SingleColumnValueFilter('f1', 'a1', =, 'binary:a2')"}
> ROW                                                         COLUMN+CELL
>  r1                                                         column=f1:a1, timestamp=1516313683984, value=a2
>  r1                                                         column=f1:b1, timestamp=1516313700744, value=b2
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)