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/04/05 13:57:00 UTC

[jira] [Comment Edited] (HBASE-20151) Bug with SingleColumnValueFilter and FamilyFilter

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

Reid Chan edited comment on HBASE-20151 at 4/5/18 1:56 PM:
-----------------------------------------------------------

bq. If false it will check any version for the condition.
Ya~, if only FF' specified family is the same as SCVF's family, and results are expected in fact,
{code}
hbase(main):009:0> scan 'test', {FILTER => "FamilyFilter(=,'binary:a') AND SingleColumnValueFilter('a','10',=,'binary:', false, false)", VERSIONS => 3}
ROW                                              COLUMN+CELL
 1                                               column=a:1, timestamp=1522926356603, value=
 1                                               column=a:10, timestamp=1522926787107, value=1
 1                                               column=a:10, timestamp=1522926361500, value=
1 row(s)
{code}
Otherwise (e.g., FF specifies 'b', while SCVF is 'a'), older versions are skipped and never checked whichever FF returns NEXT_COL (this patch) or NEXT_ROW (origin).
FF advances too fast in this case i think. If FF returns SKIP, correct results are expected at the sacrifice of performance which i don't think is the best idea. Any thoughts? ping [~anoop.hbase]
{code:title=FF returns SKIP, a:10:nil is older version}
hbase(main):002:0> scan 'test', {FILTER => "FamilyFilter(=,'binary:b') AND SingleColumnValueFilter('a','10',=,'binary:', false, false)", VERSIONS => 3}
ROW                                              COLUMN+CELL
 1                                               column=b:2, timestamp=1522926369107, value=
1 row(s)
{code}



was (Author: reidchan):
> If false it will check any version for the condition.
Ya~, if only FF' specified family is the same as SCVF's family, and results are expected in fact,
{code}
hbase(main):009:0> scan 'test', {FILTER => "FamilyFilter(=,'binary:a') AND SingleColumnValueFilter('a','10',=,'binary:', false, false)", VERSIONS => 3}
ROW                                              COLUMN+CELL
 1                                               column=a:1, timestamp=1522926356603, value=
 1                                               column=a:10, timestamp=1522926787107, value=1
 1                                               column=a:10, timestamp=1522926361500, value=
1 row(s)
{code}
Otherwise (e.g., FF specifies 'b', while SCVF is 'a'), older versions are skipped and never checked whichever FF returns NEXT_COL (this patch) or NEXT_ROW (origin).
FF advances too fast in this case i think. If FF returns SKIP, correct results are expected at the sacrifice of performance which i don't think is the best idea. Any thoughts? ping [~anoop.hbase]
{code:title=FF returns SKIP, a:10:nil is older version}
hbase(main):002:0> scan 'test', {FILTER => "FamilyFilter(=,'binary:b') AND SingleColumnValueFilter('a','10',=,'binary:', false, false)", VERSIONS => 3}
ROW                                              COLUMN+CELL
 1                                               column=b:2, timestamp=1522926369107, value=
1 row(s)
{code}


> Bug with SingleColumnValueFilter and FamilyFilter
> -------------------------------------------------
>
>                 Key: HBASE-20151
>                 URL: https://issues.apache.org/jira/browse/HBASE-20151
>             Project: HBase
>          Issue Type: Bug
>         Environment: MacOS 10.13.3
> HBase 1.3.1
>            Reporter: Steven Sadowski
>            Assignee: Reid Chan
>            Priority: Major
>             Fix For: 2.0.0
>
>         Attachments: HBASE-20151.master.001.patch
>
>
> When running the following queries, the result is sometimes return correctly and other times incorrectly based on the qualifier queried.
> Setup:
> {code:java}
> create 'test', 'a', 'b'
> test = get_table 'test'
> test.put '1', 'a:1', nil
> test.put '1', 'a:10', nil
> test.put '1', 'b:2', nil
> {code}
>  
>  This query works fine when the SCVF's qualifier has length 1 (i.e. '1') :
> {code:java}
> test.scan({ FILTER => "( SingleColumnValueFilter('a','1',=,'binary:',true,true) AND FamilyFilter(=,'binary:b') )"})
> ROW                                       COLUMN+CELL
>  1                                        column=b:2, timestamp=1520455888059, value=
> 1 row(s) in 0.0060 seconds
> {code}
>  
> The query should return the same result when passed a qualifier of length 2 (i.e. '10') :
> {code:java}
> test.scan({ FILTER => "( SingleColumnValueFilter('a','10',=,'binary:',true,true) AND FamilyFilter(=,'binary:b') )"})
> ROW                                       COLUMN+CELL
> 0 row(s) in 0.0110 seconds
> {code}
> However, in this case, it does not return any row (expected result would be to return the same result as the first query).
>  
> Removing the family filter while the qualifier is '10' yields expected results:
> {code:java}
> test.scan({ FILTER => "( SingleColumnValueFilter('a','10',=,'binary:',true,true) )"})
> ROW                                       COLUMN+CELL
>  1                                        column=a:1, timestamp=1520455887954, value=
>  1                                        column=a:10, timestamp=1520455888024, value=
>  1                                        column=b:2, timestamp=1520455888059, value=
> 1 row(s) in 0.0140 seconds
> {code}
>  
>  



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