Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 90FA7E89B for ; Mon, 7 Jan 2013 13:10:14 +0000 (UTC) Received: (qmail 62701 invoked by uid 500); 7 Jan 2013 13:10:14 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 62574 invoked by uid 500); 7 Jan 2013 13:10:13 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 62537 invoked by uid 500); 7 Jan 2013 13:10:13 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 62526 invoked by uid 99); 7 Jan 2013 13:10:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 13:10:13 +0000 Date: Mon, 7 Jan 2013 13:10:13 +0000 (UTC) From: "binlijin (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: =?utf-8?Q?[jira]_[Updated]_(HIVE-3868)_Use_Hive=E2=80=98s_serd?= =?utf-8?Q?e_to_parse_HBase=E2=80=99s_byte_Data_in_LazyHBaseRow?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-3868?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] binlijin updated HIVE-3868: --------------------------- Description:=20 In LazyHBaseRow=EF=BC=8C {code} private Object uncheckedGetField(int fieldID) { // it is a column i.e. a column-family with column-qualifier byte [] res =3D result.getValue(colMap.familyNameBytes, colMap.qu= alifierNameBytes); if (res =3D=3D null) { return null; } else { ref =3D new ByteArrayRef(); ref.setData(res); } if (ref !=3D null) { fields[fieldID].init(ref, 0, ref.getData().length); } } For example, if the fields[fieldID] is Bigint, and ref stores HBase byte = data (Long),=20 it will use LazyLong to parse this data and will return NULL value,=20 it should use Bytes.toLong(res.getData()) to parse this byte data {code} was: In LazyHBaseRow=EF=BC=8C {code} private Object uncheckedGetField(int fieldID) { // it is a column i.e. a column-family with column-qualifier byte [] res =3D result.getValue(colMap.familyNameBytes, colMap.qu= alifierNameBytes); if (res =3D=3D null) { return null; } else { ref =3D new ByteArrayRef(); ref.setData(res); } if (ref !=3D null) { fields[fieldID].init(ref, 0, ref.getData().length); } } For example, if the fields[fieldID] is Bigint, and ref stores HBase byte = data (Long), it will use LazyLong to parse this data and will return NULL v= alue, it should use Bytes.toLong(res.getData()) to parse this byte data {code} =20 > Use Hive=E2=80=98s serde to parse HBase=E2=80=99s byte Data in LazyHBaseR= ow > ----------------------------------------------------------- > > Key: HIVE-3868 > URL: https://issues.apache.org/jira/browse/HIVE-3868 > Project: Hive > Issue Type: Bug > Components: HBase Handler > Affects Versions: 0.9.0 > Reporter: binlijin > > In LazyHBaseRow=EF=BC=8C > {code} > private Object uncheckedGetField(int fieldID) { > // it is a column i.e. a column-family with column-qualifier > byte [] res =3D result.getValue(colMap.familyNameBytes, colMap.= qualifierNameBytes); > if (res =3D=3D null) { > return null; > } else { > ref =3D new ByteArrayRef(); > ref.setData(res); > } > if (ref !=3D null) { > fields[fieldID].init(ref, 0, ref.getData().length); > } > } > For example, if the fields[fieldID] is Bigint, and ref stores HBase byt= e data (Long),=20 > it will use LazyLong to parse this data and will return NULL value,=20 > it should use Bytes.toLong(res.getData()) to parse this byte data > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira