[ 
https://issues.apache.org/jira/browse/HBASE-27972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chaijunjie updated HBASE-27972:
-------------------------------
    Description: 
When I run these tests in hbase shell.

like this:

select cq1 from t1 where cq1<='2' and cq2>='5'

select cq1 from t1 where cq1<='2' or cq2>='5'

all these results is  is different from expectations...the results is different 
with MySQL and others DB...
{code:java}
// Test
create 't1',{NAME=>'cf1'}
put 't1','r1','cf1:cq1','1'
put 't1','r1','cf1:cq2','2'
put 't1','r2','cf1:cq1','2'
put 't1','r2','cf1:cq2','3'
put 't1','r3','cf1:cq1','3'
put 't1','r3','cf1:cq2','4'
put 't1','r4','cf1:cq1','4'
put 't1','r4','cf1:cq2','5'
java_import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
java_import org.apache.hadoop.hbase.util.Bytes
java_import org.apache.hadoop.hbase.filter.CompareFilter
java_import org.apache.hadoop.hbase.filter.FilterList
filter1=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq1'),CompareFilter::CompareOp::LESS_OR_EQUAL,Bytes::toBytes('2'))
filter2=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq2'),CompareFilter::CompareOp::GREATER_OR_EQUAL,Bytes::toBytes('5'))
filterList1=FilterList.new(FilterList::Operator::MUST_PASS_ONE,filter1,filter2)
filterList2=FilterList.new(FilterList::Operator::MUST_PASS_ALL,filter1,filter2)
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filter1}
scan 't1',{COLUMNS=>['cf1:cq2'],FILTER =>filter2}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList1}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList2} {code}
!image-2023-07-13-17-34-03-488.png!

when setFilterIfMissing.... it also wrong

 
{code:java}
java_import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
java_import org.apache.hadoop.hbase.util.Bytes
java_import org.apache.hadoop.hbase.filter.CompareFilter
java_import org.apache.hadoop.hbase.filter.FilterList
filter1=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq1'),CompareFilter::CompareOp::LESS_OR_EQUAL,Bytes::toBytes('2'))
filter1::setFilterIfMissing(true)
filter2=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq2'),CompareFilter::CompareOp::GREATER_OR_EQUAL,Bytes::toBytes('5'))
filter2::setFilterIfMissing(true)
filterList1=FilterList.new(FilterList::Operator::MUST_PASS_ONE,filter1,filter2)
filterList2=FilterList.new(FilterList::Operator::MUST_PASS_ALL,filter1,filter2)
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filter1}
scan 't1',{COLUMNS=>['cf1:cq2'],FILTER =>filter2}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList1}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList2}  {code}
 

 

 

  was:
When I run these tests in hbase shell.

like this:

select cq1 from t1 where cq1<='2' and cq2>='5'

select cq1 from t1 where cq1<='2' or cq2>='5'

all these results is  is different from expectations...the results is different 
with MySQL and others DB...
{code:java}
// Test
create 't1',{NAME=>'cf1'}
put 't1','r1','cf1:cq1','1'
put 't1','r1','cf1:cq2','2'
put 't1','r2','cf1:cq1','2'
put 't1','r2','cf1:cq2','3'
put 't1','r3','cf1:cq1','3'
put 't1','r3','cf1:cq2','4'
put 't1','r4','cf1:cq1','4'
put 't1','r4','cf1:cq2','5'
java_import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
java_import org.apache.hadoop.hbase.util.Bytes
java_import org.apache.hadoop.hbase.filter.CompareFilter
java_import org.apache.hadoop.hbase.filter.FilterList
filter1=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq1'),CompareFilter::CompareOp::LESS_OR_EQUAL,Bytes::toBytes('2'))
filter2=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq2'),CompareFilter::CompareOp::GREATER_OR_EQUAL,Bytes::toBytes('5'))
filterList1=FilterList.new(FilterList::Operator::MUST_PASS_ONE,filter1,filter2)
filterList2=FilterList.new(FilterList::Operator::MUST_PASS_ALL,filter1,filter2)
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filter1}
scan 't1',{COLUMNS=>['cf1:cq2'],FILTER =>filter2}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList1}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList2} {code}
!image-2023-07-13-17-34-03-488.png!

when setFilterIfMissing.... it also wrong

 
{code:java}
java_import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
java_import org.apache.hadoop.hbase.util.Bytes
java_import org.apache.hadoop.hbase.filter.CompareFilter
java_import org.apache.hadoop.hbase.filter.FilterList
filter1=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq1'),CompareFilter::CompareOp::LESS_OR_EQUAL,Bytes::toBytes('2'))
filter1::setFilterIfMissing(true)
filter2=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq2'),CompareFilter::CompareOp::GREATER_OR_EQUAL,Bytes::toBytes('5'))
filter2::setFilterIfMissing(true)
filterList1=FilterList.new(FilterList::Operator::MUST_PASS_ONE,filter1,filter2)
filterList2=FilterList.new(FilterList::Operator::MUST_PASS_ALL,filter1,filter2)
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filter1}
scan 't1',{COLUMNS=>['cf1:cq2'],FILTER =>filter2}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList1}
scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList2}  {code}
!file:///C:/Users/c00580863/AppData/Roaming/eSpace_Desktop/UserData/c00580863/imagefiles/FA2B0B2E-C50A-4159-989A-FAA7B3CD04B1.png|id=FA2B0B2E-C50A-4159-989A-FAA7B3CD04B1,vspace=3!

 


> Scan result wrong when using filterlist and specifing scan colums
> -----------------------------------------------------------------
>
>                 Key: HBASE-27972
>                 URL: https://issues.apache.org/jira/browse/HBASE-27972
>             Project: HBase
>          Issue Type: Bug
>          Components: Filters
>    Affects Versions: 2.4.14
>            Reporter: chaijunjie
>            Priority: Major
>         Attachments: image-2023-07-13-17-34-03-488.png, test2.PNG
>
>
> When I run these tests in hbase shell.
> like this:
> select cq1 from t1 where cq1<='2' and cq2>='5'
> select cq1 from t1 where cq1<='2' or cq2>='5'
> all these results is  is different from expectations...the results is 
> different with MySQL and others DB...
> {code:java}
> // Test
> create 't1',{NAME=>'cf1'}
> put 't1','r1','cf1:cq1','1'
> put 't1','r1','cf1:cq2','2'
> put 't1','r2','cf1:cq1','2'
> put 't1','r2','cf1:cq2','3'
> put 't1','r3','cf1:cq1','3'
> put 't1','r3','cf1:cq2','4'
> put 't1','r4','cf1:cq1','4'
> put 't1','r4','cf1:cq2','5'
> java_import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
> java_import org.apache.hadoop.hbase.util.Bytes
> java_import org.apache.hadoop.hbase.filter.CompareFilter
> java_import org.apache.hadoop.hbase.filter.FilterList
> filter1=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq1'),CompareFilter::CompareOp::LESS_OR_EQUAL,Bytes::toBytes('2'))
> filter2=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq2'),CompareFilter::CompareOp::GREATER_OR_EQUAL,Bytes::toBytes('5'))
> filterList1=FilterList.new(FilterList::Operator::MUST_PASS_ONE,filter1,filter2)
> filterList2=FilterList.new(FilterList::Operator::MUST_PASS_ALL,filter1,filter2)
> scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filter1}
> scan 't1',{COLUMNS=>['cf1:cq2'],FILTER =>filter2}
> scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList1}
> scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList2} {code}
> !image-2023-07-13-17-34-03-488.png!
> when setFilterIfMissing.... it also wrong
>  
> {code:java}
> java_import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
> java_import org.apache.hadoop.hbase.util.Bytes
> java_import org.apache.hadoop.hbase.filter.CompareFilter
> java_import org.apache.hadoop.hbase.filter.FilterList
> filter1=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq1'),CompareFilter::CompareOp::LESS_OR_EQUAL,Bytes::toBytes('2'))
> filter1::setFilterIfMissing(true)
> filter2=SingleColumnValueFilter.new(Bytes::toBytes('cf1'),Bytes::toBytes('cq2'),CompareFilter::CompareOp::GREATER_OR_EQUAL,Bytes::toBytes('5'))
> filter2::setFilterIfMissing(true)
> filterList1=FilterList.new(FilterList::Operator::MUST_PASS_ONE,filter1,filter2)
> filterList2=FilterList.new(FilterList::Operator::MUST_PASS_ALL,filter1,filter2)
> scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filter1}
> scan 't1',{COLUMNS=>['cf1:cq2'],FILTER =>filter2}
> scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList1}
> scan 't1',{COLUMNS=>['cf1:cq1'],FILTER =>filterList2}  {code}
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to