Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2A091200CA8 for ; Thu, 15 Jun 2017 19:31:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 28BAA160BC9; Thu, 15 Jun 2017 17:31:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4A4C0160BED for ; Thu, 15 Jun 2017 19:31:10 +0200 (CEST) Received: (qmail 28246 invoked by uid 500); 15 Jun 2017 17:31:09 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 28144 invoked by uid 99); 15 Jun 2017 17:31:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2017 17:31:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D67F2180370 for ; Thu, 15 Jun 2017 17:31:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id dns8rQgHAr1Y for ; Thu, 15 Jun 2017 17:31:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C74365FCA1 for ; Thu, 15 Jun 2017 17:31:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5BDFBE00A3 for ; Thu, 15 Jun 2017 17:31:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4886221E18 for ; Thu, 15 Jun 2017 17:31:00 +0000 (UTC) Date: Thu, 15 Jun 2017 17:31:00 +0000 (UTC) From: "Sean Busbey (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-17678) FilterList with MUST_PASS_ONE may lead to redundant cells returned MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 15 Jun 2017 17:31:11 -0000 [ https://issues.apache.org/jira/browse/HBASE-17678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16050826#comment-16050826 ] Sean Busbey commented on HBASE-17678: ------------------------------------- yeah, I'd agree this should go into the maintenance releases. > FilterList with MUST_PASS_ONE may lead to redundant cells returned > ------------------------------------------------------------------ > > Key: HBASE-17678 > URL: https://issues.apache.org/jira/browse/HBASE-17678 > Project: HBase > Issue Type: Bug > Components: Filters > Affects Versions: 2.0.0, 1.3.0, 1.2.1 > Environment: RedHat 7.x > Reporter: Jason Tokayer > Assignee: Zheng Hu > Attachments: HBASE-17678.addendum.patch, HBASE-17678.addendum.patch, HBASE-17678.branch-1.1.v1.patch, HBASE-17678.branch-1.1.v2.patch, HBASE-17678.branch-1.1.v2.patch, HBASE-17678.branch-1.v1.patch, HBASE-17678.branch-1.v1.patch, HBASE-17678.branch-1.v2.patch, HBASE-17678.branch-1.v2.patch, HBASE-17678.v1.patch, HBASE-17678.v1.rough.patch, HBASE-17678.v2.patch, HBASE-17678.v3.patch, HBASE-17678.v4.patch, HBASE-17678.v4.patch, HBASE-17678.v5.patch, HBASE-17678.v6.patch, HBASE-17678.v7.patch, HBASE-17678.v7.patch, TestColumnPaginationFilterDemo.java > > > When combining ColumnPaginationFilter with a single-element filterList, MUST_PASS_ONE and MUST_PASS_ALL give different results when there are multiple cells with the same timestamp. This is unexpected since there is only a single filter in the list, and I would believe that MUST_PASS_ALL and MUST_PASS_ONE should only affect the behavior of the joined filter and not the behavior of any one of the individual filters. If this is not a bug then it would be nice if the documentation is updated to explain this nuanced behavior. > I know that there was a decision made in an earlier Hbase version to keep multiple cells with the same timestamp. This is generally fine but presents an issue when using the aforementioned filter combination. > Steps to reproduce: > In the shell create a table and insert some data: > {code:none} > create 'ns:tbl',{NAME => 'family',VERSIONS => 100} > put 'ns:tbl','row','family:name','John',1000000000000 > put 'ns:tbl','row','family:name','Jane',1000000000000 > put 'ns:tbl','row','family:name','Gil',1000000000000 > put 'ns:tbl','row','family:name','Jane',1000000000000 > {code} > Then, use a Scala client as: > {code:none} > import org.apache.hadoop.hbase.filter._ > import org.apache.hadoop.hbase.util.Bytes > import org.apache.hadoop.hbase.client._ > import org.apache.hadoop.hbase.{CellUtil, HBaseConfiguration, TableName} > import scala.collection.mutable._ > val config = HBaseConfiguration.create() > config.set("hbase.zookeeper.quorum", "localhost") > config.set("hbase.zookeeper.property.clientPort", "2181") > val connection = ConnectionFactory.createConnection(config) > val logicalOp = FilterList.Operator.MUST_PASS_ONE > val limit = 1 > var resultsList = ListBuffer[String]() > for (offset <- 0 to 20 by limit) { > val table = connection.getTable(TableName.valueOf("ns:tbl")) > val paginationFilter = new ColumnPaginationFilter(limit,offset) > val filterList: FilterList = new FilterList(logicalOp,paginationFilter) > println("@ filterList = "+filterList) > val results = table.get(new Get(Bytes.toBytes("row")).setFilter(filterList)) > val cells = results.rawCells() > if (cells != null) { > for (cell <- cells) { > val value = new String(CellUtil.cloneValue(cell)) > val qualifier = new String(CellUtil.cloneQualifier(cell)) > val family = new String(CellUtil.cloneFamily(cell)) > val result = "OFFSET = "+offset+":"+family + "," + qualifier + "," + value + "," + cell.getTimestamp() > resultsList.append(result) > } > } > } > resultsList.foreach(println) > {code} > Here are the results for different limit and logicalOp settings: > {code:none} > Limit = 1 & logicalOp = MUST_PASS_ALL: > scala> resultsList.foreach(println) > OFFSET = 0:family,name,Jane,1000000000000 > Limit = 1 & logicalOp = MUST_PASS_ONE: > scala> resultsList.foreach(println) > OFFSET = 0:family,name,Jane,1000000000000 > OFFSET = 1:family,name,Gil,1000000000000 > OFFSET = 2:family,name,Jane,1000000000000 > OFFSET = 3:family,name,John,1000000000000 > Limit = 2 & logicalOp = MUST_PASS_ALL: > scala> resultsList.foreach(println) > OFFSET = 0:family,name,Jane,1000000000000 > Limit = 2 & logicalOp = MUST_PASS_ONE: > scala> resultsList.foreach(println) > OFFSET = 0:family,name,Jane,1000000000000 > OFFSET = 2:family,name,Jane,1000000000000 > {code} > So, it seems that MUST_PASS_ALL gives the expected behavior, but MUST_PASS_ONE does not. Furthermore, MUST_PASS_ONE seems to give only a single (not-duplicated) within a page, but not across pages. -- This message was sent by Atlassian JIRA (v6.4.14#64029)