hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Capriolo <edlinuxg...@gmail.com>
Subject Re: protobuf 2.4.1 and ObjectInspector
Date Wed, 23 May 2012 02:00:28 GMT
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
<kulkarni.swarnim@gmail.com> wrote:
> I am trying to use the ReflectionStructObjectInspector to extract fields
> from a protobuf generated from 2.4.1 compiler. I am seeing that reflections
> fails to extract fields out of the generated protobuf class. Specifically,
> this code snippet:
>
> public static Field[] getDeclaredNonStaticFields(Class<?> c) {
>
>     Field[] f = c.getDeclaredFields();    // This returns back the correct
> number of fields
>
>     ArrayList<Field> af = new ArrayList<Field>();
>
>     for (int i = 0; i < f.length; ++i) {
>
>       // The logic here falls flat as it is looking only for the non-static
> fields and all generated fields
>
>      // seem to be static
>
>       if (!Modifier.isStatic(f[i].getModifiers())) {
>
>         af.add(f[i]);
>
>       }
>
>     }
>
>     Field[] r = new Field[af.size()];
>
>     for (int i = 0; i < af.size(); ++i) {
>
>       r[i] = af.get(i);
>
>     }
>
>     return r;
>
>   }
>
>
> This causes the whole ObjectInspector to fail. Has anyone else seen this
> issue too?
>

Mime
View raw message