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 86BAA200B5A for ; Thu, 4 Aug 2016 11:13:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 855B3160AAB; Thu, 4 Aug 2016 09:13:51 +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 A7C31160A7C for ; Thu, 4 Aug 2016 11:13:50 +0200 (CEST) Received: (qmail 17260 invoked by uid 500); 4 Aug 2016 09:13:44 -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 17244 invoked by uid 99); 4 Aug 2016 09:13:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Aug 2016 09:13:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B50841A72F0 for ; Thu, 4 Aug 2016 09:13:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id GOtAb2p8uQBD for ; Thu, 4 Aug 2016 09:13:42 +0000 (UTC) Received: from mail-yb0-f180.google.com (mail-yb0-f180.google.com [209.85.213.180]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 3AFD55F5CB for ; Thu, 4 Aug 2016 09:13:42 +0000 (UTC) Received: by mail-yb0-f180.google.com with SMTP id e125so3427979ybc.0 for ; Thu, 04 Aug 2016 02:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=VQ3J+8Pd93pA8yl3Q/7b1xFZgFutuAbKFrznFF8kGzQ=; b=TO9xcmB97E1I+8ukuKZgf5dGO94/xnLVrrfyDPMcdfq9UpEd53kp/qn+Lt1LKpoXcF bkzfJP3q3UuyHDebG6pyxKuj0a/Uvwly2cC0DSNdZDQ97YoeGaPq4cGewX40IwMSFOSx fbGxQfuSWuCBynYNT/eA8/YeCm8EDJ5bGodNUMS3PW/KZjmv+I+QpDODb0tDzvC6dyeC JfKnBmj8Yf9e3tGBbYnpHS4JiVbAC7GpK+2C42IbCuaOg3+8HwcHtDg7skvjs8XgeWPA z+o5IsqdPcBw8GiRQX9Ne0VmBeyDWNSqJkcnr3RwFOaEGUUEPg9hD9yBeUpD1S3fjNZm d/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=VQ3J+8Pd93pA8yl3Q/7b1xFZgFutuAbKFrznFF8kGzQ=; b=Dgd+j0supAsjURJTHwbxWkUNuzYsMsFjtxpYSJ8HyiMNxAIPDZ7xlB3lzxU8ihCUrz hVphMPwXJslzPWWGQWtz4+l3y5nypQtOzFSea+q2bQk1Adv6bDSvTELsXZlQn4EPqkXV ph6pyZ/hEw1EdDGZT1MlTopl/bsrjmfh9IPLbQjn2HkNXnUCJ/kAowo1+oS045Zo/Kiq RGWct05eEevBg60hAeusCMLj12TQHpD7uUp+XH3QHvYNhRwZg3IHhfaq+IMBZdctkxai 9PMfID59TpqjUxtajnhOZcRHRuYGWppWqrk7nzWd8Qr/pifhVaabRwkPfXfL9bCj2rM1 xGew== X-Gm-Message-State: AEkoouuimSFpwTC3HaGFWiqdO1qd9qTVkroJj8AqVcphj+9HS+GLL1o6Bgwib+YOl1xF5E0JsXB/oRziGkSvnA== X-Received: by 10.37.197.79 with SMTP id v76mr52793536ybe.25.1470302015868; Thu, 04 Aug 2016 02:13:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.197.7 with HTTP; Thu, 4 Aug 2016 02:13:35 -0700 (PDT) In-Reply-To: References: From: Ted Yu Date: Thu, 4 Aug 2016 02:13:35 -0700 Message-ID: Subject: Re: query multiple specified columns using filterlist To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=94eb2c147ffe5e53fa05393b5db9 archived-at: Thu, 04 Aug 2016 09:13:51 -0000 --94eb2c147ffe5e53fa05393b5db9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can use FilterList to put the filters together: public FilterList(final Operator operator) { AND -> MUST_PASS_ALL On Thu, Aug 4, 2016 at 2:07 AM, =E4=B9=94=E5=BD=A6=E5=85=8B wrote: > Thanks for the advice, Ted. > I have the column prefix and the column value( in fact these two filters > are are in the same column), but don't have the column name, so I can't u= se > SingleColumnValueFilter. > *Now I use two qualifierFilters and a ColumnPrefixFilter to specify three > columns, and a value filter to filter the values. The logical between the= se > Filters are 'OR', but what I want is 'AND'? Is there some ways to help = me > with that? Below is the filters I used.* > > QualifierFilter qfilter =3D new > QualifierFilter(CompareFilter.CompareOp.EQUAL, new > BinaryComparator(Bytes.toBytes("qualifier1"))); > QualifierFilter qfilter2 =3D new > QualifierFilter(CompareFilter.CompareOp.EQUAL, new > BinaryComparator(Bytes.toBytes("qualifier2"))); > > // *'e:cat' is the column prefix, and 'hello kitty' is the value of > 'e:cat?' column* > > ColumnPrefixFilter columnPrefixFilter =3D new > ColumnPrefixFilter(Bytes.toBytes("e:cat")); > > Filter valueFilter =3D new ValueFilter(CompareFilter.CompareOp.EQUAL, > new BinaryComparator( > Bytes.toBytes("hello kitty"))); > > > > Ted Yu =E4=BA=8E2016=E5=B9=B48=E6=9C=884=E6=97=A5=E5= =91=A8=E5=9B=9B =E4=B8=8A=E5=8D=8811:56=E5=86=99=E9=81=93=EF=BC=9A > > > For selecting column with same prefix, consider using ColumnPrefixFilte= r. > > > > For filtering value, consider using SingleColumnValueFilter. > > > > On Wed, Aug 3, 2016 at 7:52 PM, =E4=B9=94=E5=BD=A6=E5=85=8B wrote: > > > > > Thanks for your reply, Ted. > > > Addition, if I want to filter another column -- one or many columns > with > > > one same column prefix, how can I deal with the filter or filter list= . > > what > > > if I have to filter a value from the columns, beside to use > valueFilter, > > is > > > there another filter or filter to query this? > > > > > > eg: column prefix :* e:cat*, > > > specified columns maybe: *e:cat1, e:cat2, e:cat3,* > > > the value :* 'hello kitty' ,* > > > > > > Any advice is appreciated! > > > QiaoYanke > > > > > > > > > Ted Yu =E4=BA=8E2016=E5=B9=B48=E6=9C=883=E6=97= =A5=E5=91=A8=E4=B8=89 =E4=B8=8A=E5=8D=883:15=E5=86=99=E9=81=93=EF=BC=9A > > > > > > > You can use the following method of Scan to specify columns to > > retrieve: > > > > > > > > public Scan addColumn(byte [] family, byte [] qualifier) { > > > > > > > > w.r.t. value comparison with cf:c3 column, consider using > > > > SingleColumnValueFilter. > > > > > > > > Cheers > > > > > > > > On Mon, Aug 1, 2016 at 6:56 PM, =E4=B9=94=E5=BD=A6=E5=85=8B wrote: > > > > > > > > > Hi all, > > > > > > > > > > Currently I am using HBase client api to fetch data from HBase, > and I > > > > want > > > > > to get 3 columns (cf:c1,cf:c2,cf:c3), and some value equals cf:c3 > > > column, > > > > > But I don't know how to construct the filterList to achieve this, > So > > > How > > > > > can I do with that=EF=BC=9F > > > > > Any suggestion will be appreciated! > > > > > > > > > > > > > > > Best Regards=EF=BC=8C > > > > > QiaoYanke > > > > > > > > > > > > > > > --94eb2c147ffe5e53fa05393b5db9--