Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 39FF610BA4 for ; Fri, 9 Aug 2013 19:16:01 +0000 (UTC) Received: (qmail 64677 invoked by uid 500); 9 Aug 2013 19:15:55 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 64539 invoked by uid 500); 9 Aug 2013 19:15:55 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 64532 invoked by uid 99); 9 Aug 2013 19:15:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Aug 2013 19:15:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hpnole@gmail.com designates 209.85.220.42 as permitted sender) Received: from [209.85.220.42] (HELO mail-pa0-f42.google.com) (209.85.220.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Aug 2013 19:15:46 +0000 Received: by mail-pa0-f42.google.com with SMTP id lj1so5299054pab.15 for ; Fri, 09 Aug 2013 12:15:24 -0700 (PDT) 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=h7pdRyVW0/beobKt6m6p3S2ZaNJIqIlOufYx25krImA=; b=R6eq+fqlqoHbHJnmb7OiV3tpa3zjvi9+Ti93gob7LFY9uoZswFq6EoLyRAhkS/MpC/ FUvasM7Ge5e4DT8idanPtLUw1m4EUMa4dIP7jZOgA9QN5VrjxAM+E0a5J9KZygvL1lOA RJ+GBEw/p5ov0C8OGmtS4Hj2f6b5B896/wW9ww8o16jULvGVJms8cGzPNS2HPvmo/jmM Jy4oqRryUjRsBKwp/7qQRVQS5QiDrY7C5ZTEaI+qvNj8gKUUuN9LDwivptiwaV4I8ROR VuV3AZMfbNqCPXAAVPX5bGL16elrj+RQ4D8WweZsiY3193hdQRuV9rCh7B1x1lDMWDD3 NdfA== MIME-Version: 1.0 X-Received: by 10.69.17.1 with SMTP id ga1mr12904530pbd.38.1376075724870; Fri, 09 Aug 2013 12:15:24 -0700 (PDT) Received: by 10.68.184.197 with HTTP; Fri, 9 Aug 2013 12:15:24 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Aug 2013 14:15:24 -0500 Message-ID: Subject: Re: Hadoop-HBase table hierarchical column scan From: Narlin M To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=047d7bd74a6ec3d8bb04e38898e3 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd74a6ec3d8bb04e38898e3 Content-Type: text/plain; charset=ISO-8859-1 Correction: Its scan.addColumn(family, qualifier) and not scan.addFamily(family, qualifier) that I actually used. Thanks, Narlin M. On Fri, Aug 9, 2013 at 2:08 PM, Narlin M wrote: > I am fairly new to the hadoop-hbase environment having started working on > it very recently, so I hope I am wording the question correctly. > > I am trying to read data from a hadoop-hbase table which has only one > column family named 'DFLT'. This family contains hierarchical column > qualifiers "/source:int64/name:string". I want to read the name column for > a particular source value, say 10. How can I achieve this using the Scan > class? > > I tried setting up the scan object as follows: > > ... > > byte[] family = Bytes.toBytes("DFLT"); > byte[] qualifier = Bytes.toBytes("source:name"); > > Scan scan = new Scan(); > scan.addFamily(family, qualifier); > > FilterList list = new FilterList(FilterList.Operator.MUST_PASS_ALL); > > SingleColumnValueFilter filter = new SingleColumnValueFilter(family, > Bytes.toBytes("source"), CompareFilter.CompareOp.EQUAL, Bytes.toBytes(10) > ); > > list.addFilter(filter); > > scan.setFilter(list); > > ... > > > But I do not get any data back with this setup. I am guessing that I am > not setting up the hierarchical qualifiers correctly. Any and all pointers > will be appreciated. > > Thanks, Narlin M. > --047d7bd74a6ec3d8bb04e38898e3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Correction: Its=A0scan.addColumn(family, qualifier) and not=A0scan.addFamily(fami= ly, qualifier) that I actually used.

Thanks, = Narlin M.


On Fri, Aug 9, 2013 at 2:08 PM, Narlin M <hpnole@gmail.com> w= rote:
I am fairly new to the hadoop-hbase environment having sta= rted working on it very recently, so I hope I am wording the question corre= ctly.=A0

I am trying to read data from a hadoop-hbase ta= ble which has only one column family named 'DFLT'. This family cont= ains hierarchical column qualifiers "/source:int64/name:string". = I want to read the name column for a particular source value, say 10. How c= an I achieve this using the Scan class?

I tried setting up the scan object as follows:

...

byte[] family =3D Bytes.toByt= es("DFLT");
byte[] qualifier =3D Bytes.toBytes("so= urce:name");

Scan scan =3D new Scan();
scan.addFamily(fami= ly, qualifier);

FilterList list =3D new FilterList(FilterList.Operator.MUST_PASS_ALL);

SingleColumnValueFilter filter =3D=A0new=A0SingleColum= nValueFilter(family, Bytes.toBytes("source"), CompareFilter.Compa= reOp.EQUAL, Bytes.toBytes(10));

list.addFilter(filter);

scan.setFilter(list);

...


=

But I do not get any data back with this setup. I am guessing that I= am not setting up the hierarchical qualifiers correctly. Any and all point= ers will be appreciated.

Thanks,=A0Narlin M.


--047d7bd74a6ec3d8bb04e38898e3--