Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-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 241C99FEB for ; Tue, 17 Apr 2012 14:15:51 +0000 (UTC) Received: (qmail 79403 invoked by uid 500); 17 Apr 2012 14:15:50 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 79339 invoked by uid 500); 17 Apr 2012 14:15:50 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 79330 invoked by uid 500); 17 Apr 2012 14:15:50 -0000 Delivered-To: apmail-hadoop-hive-user@hadoop.apache.org Received: (qmail 79326 invoked by uid 99); 17 Apr 2012 14:15:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 14:15:49 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of timrobertson100@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-ob0-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 14:15:42 +0000 Received: by obbup19 with SMTP id up19so2780428obb.35 for ; Tue, 17 Apr 2012 07:15:21 -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=UHbBmeq+8BWXioCcpBtN+X/ikjpIlmmAAR19yNkvOUk=; b=Bd36jS3IHv5vT6qAhp/jnH3MsFyzk7fKAxmVq0wIMpWmFMRS05i802aetQo26DIrwI 1nH7HcZN51J18UG9UJ/q/PJKpAIzEe7z673RzqSlyX6w6B2jGeXP2wS75y7HrjI6Z3Bn CBpOIikionbyE3a2RHcajo0jEuRVZjuWsH0UpAegIiQ83GHSHNEAuGp1L54ygBdqB8nC loroX72o6ZzchxuY1UsW1DrfDK7eOqXeLfO5XfeRsaVtUOFHO4u0ie7z+X+yKbalS0by A89DGJxPpz79AEB/Gg7+n58RzcrSn3FcBzW6UiVw51h2GHjKhQZ1VmCYeuoAdarJeOjh ztrA== MIME-Version: 1.0 Received: by 10.182.169.41 with SMTP id ab9mr22289520obc.4.1334672121256; Tue, 17 Apr 2012 07:15:21 -0700 (PDT) Received: by 10.182.165.97 with HTTP; Tue, 17 Apr 2012 07:15:21 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Apr 2012 16:15:21 +0200 Message-ID: Subject: Re: Help with INTEGER on HBase (Hive-1634) From: Tim Robertson To: hive-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=e89a8f643bf2add9ec04bde09185 --e89a8f643bf2add9ec04bde09185 Content-Type: text/plain; charset=ISO-8859-1 Apologies, it does indeed work when you add the correct JARs in Hive. Tim On Tue, Apr 17, 2012 at 3:33 PM, Tim Robertson wrote: > Hi all, > > I am *really* interested in Hive-1634 ( > https://issues.apache.org/jira/browse/HIVE-1634). I have just built from > Hive trunk using HBase 0.90.4 as the version (e.g. we run cdh3u2). > > We have an HBase table populated with Bytes, so I create the Hive table > like so: > > CREATE EXTERNAL TABLE tim_hbase_occurrence ( > id int, > scientific_name string, > data_resource_id int > ) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH > SERDEPROPERTIES ( > "hbase.columns.mapping" = ":key,v:scientific_name,v:data_resource_id", > "hbase.columns.storage.types" = "b,b,b" > ) TBLPROPERTIES( > "hbase.table.name" = "mini_occurrences", > "hbase.table.default.storage.type" = "binary" > ); > > This suggests it understands the formats: > > hive> SELECT * FROM tim_hbase_occurrence LIMIT 3; > OK > 1444 Abies alba 1081 > 1445 Abies alba 1081 > 1446 Abies alba 1081 > > But doing any queries, suggest not: > > hive> SELECT * FROM tim_hbase_occurrence WHERE scientific_name='Abies > alba' limit 3; > ... > NULL Abies alba NULL > NULL Abies alba NULL > NULL Abies alba NULL > Time taken: 9.668 seconds > > hive> SELECT * FROM tim_hbase_occurrence WHERE data_resource_id=1081; > ... > 0 (no records) > > Can anyone provide any guidance on this please? > > Thanks! > Tim > > --e89a8f643bf2add9ec04bde09185 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Apologies, it does indeed work when you add the correct JARs in Hive.
<= br>
Tim



On Tue, Apr 17, 2012 at 3:33 PM, Tim Robertson <timrobertson100@gmail.= com> wrote:
Hi all,


We have an HBase table populated with Bytes, so=A0I cre= ate the Hive table like so:

CREATE EXTERNAL T= ABLE tim_hbase_occurrence (=A0
=A0 id int,
=A0 scientif= ic_name string,
=A0 data_resource_id int
) STORED BY 'org.apache.hadoop.= hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES (
=A0 &q= uot;hbase.columns.mapping" =3D ":key,v:scientific_name,v:data_res= ource_id",
=A0 "hbase.columns.storage.types" =3D "b,b,b"=A0
) TBLPROPERTIES(
=A0 "hbase.table.name" =3D "mini_occurren= ces",=A0
=A0 "hbase.table.default.storage.type" =3D "binary"= ;
);

This suggests it understands the for= mats:

hive> SELECT * FROM tim_hbase_occurr= ence LIMIT 3;
OK
1444 Abies alba 1081
1445 Abies alba 1081
1446 Abies alba 1081

But doing any queries, suggest not:
hive> SELECT * FROM tim_hbase_occurrence WHERE scientific_na= me=3D'Abies alba' limit 3;
...
NULL Abies alba NULL
NULL Abies alba NULL
NULL Abies alba NULL
Time taken: 9.668 seconds

hive> SELE= CT * FROM tim_hbase_occurrence WHERE data_resource_id=3D1081;
...=
0 (no records)

Can anyone provide any g= uidance on this please?

Thanks! =A0
Tim


--e89a8f643bf2add9ec04bde09185--