[
https://issues.apache.org/jira/browse/HBASE-18368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16122936#comment-16122936
]
Zheng Hu edited comment on HBASE-18368 at 8/11/17 7:23 AM:
-----------------------------------------------------------
bq. Even the filter return a NEXT_ROW, it still may get a cell from the same
row's different family. You can't guarantee NEXT_ROW so why you provide it to
user?
Good question. its implementation does not match its definition.
NEXT_ROW's implementation is : for StoreScanner , NEXT_ROW do one thing:
switch cell's cursor to next row in current cf. but for RegionScanner,
NEXT_ROW do two thing: switch previous cf's cell cursor to next row , and
switch cf's cursor to the next cf.
Actually, neither NEXT_ROW nor NEXT_FAMILY could express the implementation
correctly.
was (Author: openinx):
bq. Even the filter return a NEXT_ROW, it still may get a cell from the same
row's different family. You can't guarantee NEXT_ROW so why you provide it to
user?
Good question. its implementation does not match its definition.
NEXT_ROW's implementation is : for StoreScanner , NEXT_ROW do one thing:
switch cell's cursor to next row in current cf. but for RegionScanner,
NEXT_ROW do two thing: switch previous cf's cell cursor to next row , and
switch cf's cursor to the next cf.
Actually, neither NEXT_ROW or NEXT_FAMILY could express the implementation
correctly.
> FilterList with multiple FamilyFilters concatenated by OR does not work.
> ------------------------------------------------------------------------
>
> Key: HBASE-18368
> URL: https://issues.apache.org/jira/browse/HBASE-18368
> Project: HBase
> Issue Type: Sub-task
> Components: Filters
> Affects Versions: 3.0.0, 2.0.0-alpha-1
> Reporter: Peter Somogyi
> Assignee: Zheng Hu
> Priority: Critical
> Attachments: HBASE-18368.branch-1.patch,
> HBASE-18368.branch-1.v2.patch, HBASE-18368.branch-1.v3.patch,
> HBASE-18368.patch, HBASE-18368.v2.patch
>
>
> Scan gives back incomplete list if multiple filters are combined with OR /
> MUST_PASS_ONE.
> Using 2 FamilyFilters in a FilterList using MUST_PASS_ONE operator will give
> back results for only the first Filter.
> {code:java|title=Test code}
> @Test
> public void testFiltersWithOr() throws Exception {
> TableName tn = TableName.valueOf("MyTest");
> Table table = utility.createTable(tn, new String[] {"cf1", "cf2"});
> byte[] CF1 = Bytes.toBytes("cf1");
> byte[] CF2 = Bytes.toBytes("cf2");
> Put put1 = new Put(Bytes.toBytes("0"));
> put1.addColumn(CF1, Bytes.toBytes("col_a"), Bytes.toBytes(0));
> table.put(put1);
> Put put2 = new Put(Bytes.toBytes("0"));
> put2.addColumn(CF2, Bytes.toBytes("col_b"), Bytes.toBytes(0));
> table.put(put2);
> FamilyFilter filterCF1 = new FamilyFilter(CompareFilter.CompareOp.EQUAL,
> new BinaryComparator(CF1));
> FamilyFilter filterCF2 = new FamilyFilter(CompareFilter.CompareOp.EQUAL,
> new BinaryComparator(CF2));
> FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ONE);
> filterList.addFilter(filterCF1);
> filterList.addFilter(filterCF2);
> Scan scan = new Scan();
> scan.setFilter(filterList);
> ResultScanner scanner = table.getScanner(scan);
> System.out.println(filterList);
> for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
> System.out.println(rr);
> }
> }
> {code}
> {noformat:title=Output}
> FilterList OR (2/2): [FamilyFilter (EQUAL, cf1), FamilyFilter (EQUAL, cf2)]
> keyvalues={0/cf1:col_a/1499852754957/Put/vlen=4/seqid=0}
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)