Grokbase Groups Hive user July 2011
FAQ
With protobuf 2.4.1, Hive Serde throws an exception while inspecting the
Objects

Specifically it throws "java.lang.RuntimeException: Internal error: Cannot
find ObjectInspector for UNKNOWN"

The reason for this seems to be the way protobuf generates the java code for
any string types:

proto file ---
string serverHost = 1;
--
protobuf 2.3 generates a private field String serverHost_ (decompiled javap
-c output)

public java.lang.String getServerHost();
Code:
0: aload_0
1: getfield #29; //Field serverHost_:Ljava/lang/String;
4: areturn


whereas protobuf 2.4 generates an private field "Object serverHost_"

When the inspector comes across the java.lang.Object type it throws the
above exception.

Here is the complete stacktrace

Exception in thread "main" java.lang.RuntimeException: Internal error:
Cannot find ObjectInspector for UNKNOWN
at
org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(PrimitiveObjectInspectorFactory.java:149)
at
org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getReflectionObjectInspectorNoCache(ObjectInspectorFactory.java:146)
at
org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getReflectionObjectInspector(ObjectInspectorFactory.java:69)
at
org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getReflectionObjectInspectorNoCache(ObjectInspectorFactory.java:186)
at
org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getReflectionObjectInspector(ObjectInspectorFactory.java:69)


Note that the method still returns a String in both protobuf 2.3 as well as
2.4

Is there a reason to use fields vs public methods to get at the protobuf
schema in hive? Also is there any way around this?

thanks,
-- Nagesh

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedJul 27, '11 at 8:29p
activeJul 27, '11 at 8:29p
posts1
users1
websitehive.apache.org

1 user in discussion

Nagesh Susarla: 1 post

People

Translate

site design / logo © 2022 Grokbase