Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7950CC62 for ; Tue, 18 Nov 2014 17:07:54 +0000 (UTC) Received: (qmail 69127 invoked by uid 500); 18 Nov 2014 17:07:52 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 69050 invoked by uid 500); 18 Nov 2014 17:07:52 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 69038 invoked by uid 99); 18 Nov 2014 17:07:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2014 17:07:52 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yuzhihong@gmail.com designates 209.85.160.177 as permitted sender) Received: from [209.85.160.177] (HELO mail-yk0-f177.google.com) (209.85.160.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2014 17:07:25 +0000 Received: by mail-yk0-f177.google.com with SMTP id 9so5215264ykp.22 for ; Tue, 18 Nov 2014 09:06:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jKTTzro7ZjJ60KTkB+uPKxu2WJ+EmHFAFxQI8UBrIK4=; b=TIWx1SYtubLxLiwomlDtI7vQqF3zG5UXRtPh/+lNDH5XWM/ED0l+xZ27hiZkBYqWx1 tSDpmR1F1wIdrrTQuOrnQjvkcqNLILDuEG4gpTWoAkvevPQ/7Eh4I2rBCxNo0mIsBHyn rGhxoHWXe58RhTte+mC6060AID82iO2aRZi3Ry+iXuPildjXekCXmAXuUM/p6qLffIia FFBxrtSBR59QfQiIQXoijpzX4I8O3Hq8Ld68PkgNoXjHo7BxB0ffNCKhHh1t7Cu8dPoG /gdAk3kVXx+4lXU/qNXDACrSTnvADlKtjXcvMNnwwRhhNneA5Lb2ibW7lKZfhxDVGYbU e3Bg== MIME-Version: 1.0 X-Received: by 10.236.220.194 with SMTP id o62mr32169091yhp.32.1416330398750; Tue, 18 Nov 2014 09:06:38 -0800 (PST) Received: by 10.170.180.7 with HTTP; Tue, 18 Nov 2014 09:06:38 -0800 (PST) In-Reply-To: References: Date: Tue, 18 Nov 2014 09:06:38 -0800 Message-ID: Subject: Re: Hierarchy of filters and filters list From: Ted Yu To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=001a11c22f9c4d5f9c0508251e63 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c22f9c4d5f9c0508251e63 Content-Type: text/plain; charset=UTF-8 See TestSingleColumnValueFilter which tests SingleColumnValueFilter without spinning up minicluster. TestHRegion#testIndexesScanWithOneDeletedRow() is an example where FilterList is involved. Cheers On Tue, Nov 18, 2014 at 8:51 AM, Shahab Yunus wrote: > I don't have a unit test for HBase right now. If you can provide me a > sample or directions, then I can try. > > Regards, > Shahab > > On Tue, Nov 18, 2014 at 11:24 AM, Ted Yu wrote: > > > Are you able to reproduce this using a unit test ? > > > > I will take a closer look. > > > > Thanks > > > > On Nov 18, 2014, at 8:06 AM, Shahab Yunus > wrote: > > > > > You mean if used independently? Yes, they do. > > > > > > Regards, > > > Shahab > > > > > > On Tue, Nov 18, 2014 at 10:51 AM, Ted Yu wrote: > > > > > >> Have you verified that at least one of the following (when used alone) > > >> returns data ? > > >> (A and B), (B and C), (D and E) > > >> > > >> Thanks > > >> > > >> On Mon, Nov 17, 2014 at 9:27 PM, Shahab Yunus > > > >> wrote: > > >> > > >>> Missed couple of things. > > >>> > > >>> 1- I am using SingleColumnValueFilter and the comparator > > >>> is BinaryComparator which is passed into it. > > >>> > > >>> 2- CDH 5.1.0 > > >>> (Hbase is 0.98.1-cdh5.1.0) > > >>> > > >>> Regards, > > >>> Shahab > > >>> > > >>> On Tue, Nov 18, 2014 at 12:22 AM, Shahab Yunus < > shahab.yunus@gmail.com > > > > > >>> wrote: > > >>> > > >>>> Hi, > > >>>> > > >>>> I have data where each row has start and end time stored in UTC > > (long). > > >>>> The table is created through Phoenix and the columns have type > > >>>> UNSIGNED_DATE (which according to Phoenix docs > > >>>> < > http://phoenix.apache.org/language/datatypes.html#unsigned_date_type > > > > > >>>> does Hbase.toBytes(long) underneath for 8 bye long). I am storing > data > > >> in > > >>>> this table using regular Bytes.toBytes from HBase api as well. > > >>>> > > >>>> Now I want to query data given a time range, and get all rows lying > > >>> within > > >>>> or overlapping the search range. Pretty standard scenario. > > >>>> > > >>>> For this I create a set of filtersList. A hierarchy of filtersList > and > > >>>> filters in fact. > > >>>> > > >>>> If search criteria timerange is denoted by *sd* and *ed* > > >>>> > > >>>> And each row's date columns are denoted as *s* and *e* (signifying > > >> start > > >>>> and end datetimes.) > > >>>> > > >>>> These 4 filterLists are created as per logic given below.... > > >>>> > > >>>> filterListLeft (must past all)= This further contains 2 filters= > (sd<= > > >> s > > >>>> and ed>=s) > > >>>> > > >>>> filterListRight (must past all)=This further contains 2 filters= > (sd<= > > >> e > > >>>> and ed>=e) > > >>>> > > >>>> filterListOverlap (must past all)=This further contains 2 filters= > > >> (sd<= > > >>> s > > >>>> and ed>=e) > > >>>> > > >>>> filterListWiithin (must past all)= This further contains 2 filters= > > >> (sd>= > > >>>> s and ed<=e) > > >>>> > > >>>> > > >>>> Then I add these 4 filterLists into another filterList and that must > > >> past > > >>>> one. I realize that some records might satisfy more than one filter > > >>> above. > > >>>> But that is OK. > > >>>> > > >>>> parentFilterList = new FilterList(must past one) > > >>>> parentFilterList.addFilter(filterListLeft): > > >>>> parentFilterList.addFilter(filterListRight): > > >>>> parentFilterList.addFilter(filterListOverlap): > > >>>> parentFilterList.addFilter(filterListWithin): > > >>>> > > >>>> Note all filters have setFilterIfMissing = true. > > >>>> > > >>>> Then I pass parentFilterList.addFilter to the scanner. > > >>>> > > >>>> So it is like= (A and B) or (B and C) or (D and E) or (F and G) > > >>>> > > >>>> But what is happening is that I only get data back for the records > > >>>> matching filterListWithin. No records which satisfy the other 3 > > >>> filterList > > >>>> criteria comeback. The data exists and is valid form for other > > >>> scenarios. I > > >>>> can also view it through Phoenix UI tools. > > >>>> > > >>>> What am I missing? Could this be a phoenix issue? > > >>>> > > >>>> Thanks like always. > > >>>> > > >>>> Regards, > > >>>> Shahab > > >> > > > --001a11c22f9c4d5f9c0508251e63--