[
https://issues.apache.org/jira/browse/HBASE-20565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16471531#comment-16471531
]
Zheng Hu commented on HBASE-20565:
----------------------------------
Oh, change my mind now, it's not bug for branch-1.4, see below:
{code}
ColumnPaginationFilter
^
|---------------|
0 1 2 3 4 5 6 7 8 9
|---------------------------|
|
v
ColumnRangeFilter
{code}
The union set of ColumnPaginationFilter and ColumnRangeFilter should be
[1,2,3,4], so the size of results should be 4.
[~jinghe], I think the correct filterList to meet your requirement would be:
{code}
// Column range from 1 to 9.
StringRange stringRange = new StringRange("1", true, "9", false);
ColumnRangeFilter filter1 =
new ColumnRangeFilter(Bytes.toBytes(stringRange.getStart()),
stringRange.isStartInclusive(),
Bytes.toBytes(stringRange.getEnd()), stringRange.isEndInclusive());
// ColumnPaginationFilter limit 5
ColumnPaginationFilter filter2 = new ColumnPaginationFilter(5,
Bytes.toBytes("1")); // here, we use columnOffset instead of offset=0.
FilterList filterList = new FilterList(Operator.MUST_PASS_ALL, filter1,
filter2);
{code}
> ColumnRangeFilter combined with ColumnPaginationFilter can produce incorrect
> result since 1.4
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-20565
> URL: https://issues.apache.org/jira/browse/HBASE-20565
> Project: HBase
> Issue Type: Bug
> Components: Filters
> Affects Versions: 1.4.4
> Reporter: Jerry He
> Assignee: Zheng Hu
> Priority: Major
> Attachments: debug.diff, debug.log, test-branch-1.4.patch
>
>
> When ColumnPaginationFilter is combined with ColumnRangeFilter, we may see
> incorrect result.
> Here is a simple example.
> One row with 10 columns c0, c1, c2, .., c9. I have a ColumnRangeFilter for
> range c2 to c9. Then I have a ColumnPaginationFilter with limit 5 and offset
> 0. FileterList is FilterList(Operator.MUST_PASS_ALL, ColumnRangeFilter,
> ColumnPaginationFilter).
> We expect 5 columns being returned. But in HBase 1.4 and after, 4 columns
> are returned.
> In 1.2.x, the correct 5 columns are returned.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)