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 004CB96F1 for ; Wed, 23 May 2012 02:00:59 +0000 (UTC) Received: (qmail 88829 invoked by uid 500); 23 May 2012 02:00:58 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 88778 invoked by uid 500); 23 May 2012 02:00:57 -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 88769 invoked by uid 99); 23 May 2012 02:00:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2012 02:00:57 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of edlinuxguru@gmail.com designates 209.85.161.176 as permitted sender) Received: from [209.85.161.176] (HELO mail-gg0-f176.google.com) (209.85.161.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2012 02:00:50 +0000 Received: by ggnk4 with SMTP id k4so7830160ggn.35 for ; Tue, 22 May 2012 19:00:29 -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:content-transfer-encoding; bh=abfNmiKWN5N0a0/3HMDmLv3+yhLC9GWnhehRvmo0zPs=; b=L+DPguPsEoiPfF34E8XZf9dodtop23wd/zXYD/uoq7ZtELX9RCDo5DiAjUK4JwOXjG /GJLnLwmArrA51BBQe+V0DX9D/FDZD3v1Hpi5A+V5mu7rRbR+EGuhXk+evnz8j5ZNktU HsNCu8YGkp7uwosSZQXcxYEM9BRahDj+btsuIpzCdq4/aLfmp4ZR5ufd6KU1SoJkLQ/v 1M45F9CboAz+xsIV1nOwsw/PT8s0un5QYUZyzgderlD5nCiad5cTtoKyuLqI0pAMHgcL rAyUZJ47lKR3jKXA2/J/QQPATHQOUW5rWmIkm9+G5qBxtEzrvubxqBWYjfufmxPXPnde 6eSQ== MIME-Version: 1.0 Received: by 10.50.237.34 with SMTP id uz2mr11613628igc.19.1337738428998; Tue, 22 May 2012 19:00:28 -0700 (PDT) Received: by 10.42.27.147 with HTTP; Tue, 22 May 2012 19:00:28 -0700 (PDT) In-Reply-To: References: Date: Tue, 22 May 2012 22:00:28 -0400 Message-ID: Subject: Re: protobuf 2.4.1 and ObjectInspector From: Edward Capriolo To: user@hive.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am trying to decipher my way though the code as well. Apparently the work is half done to return ProfotBuf as a native type. As there is support for ObjectInstector.THRIFT and ObjectInspector.ProtoBuffer. I currently want to write a Serde that works like the thrift serde where protobuf objects can be given directly to hive. Come hang out in the IRC room and maybe we can chat more about this. On Tue, May 22, 2012 at 6:09 PM, kulkarni.swarnim@gmail.com wrote: > I am trying to use the=A0ReflectionStructObjectInspector to extract field= s > from a protobuf generated from 2.4.1 compiler. I am seeing that reflectio= ns > fails to extract fields out of the generated protobuf class. Specifically= , > this code snippet: > > public static Field[] getDeclaredNonStaticFields(Class c) { > > =A0 =A0 Field[] f =3D c.getDeclaredFields(); =A0 =A0// This returns back = the correct > number of fields > > =A0 =A0 ArrayList af =3D new ArrayList(); > > =A0 =A0 for (int i =3D 0; i < f.length; ++i) { > > =A0 =A0 =A0=A0// The logic here falls flat as it is looking only for the = non-static > fields and all generated fields > > =A0 =A0 =A0// seem to be static > > =A0 =A0 =A0 if (!Modifier.isStatic(f[i].getModifiers())) { > > =A0 =A0 =A0 =A0 af.add(f[i]); > > =A0 =A0 =A0 } > > =A0 =A0=A0} > > =A0 =A0 Field[] r =3D new Field[af.size()]; > > =A0 =A0 for (int i =3D 0; i < af.size(); ++i) { > > =A0 =A0 =A0 r[i] =3D af.get(i); > > =A0 =A0 } > > =A0 =A0 return r; > > =A0 } > > > This causes the whole ObjectInspector to fail. Has anyone else seen this > issue too? >