[ 
https://issues.apache.org/jira/browse/HIVE-6219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13874389#comment-13874389
 ] 

Gordon Wang commented on HIVE-6219:
-----------------------------------

I dig it a little bit further. And I think it may not be a issue in UT. This 
bug may affect the users who use protobuf 2.5.0 generated code in hive.

The root case of this bug is that the auto generated java code in protobuf 
2.5.0 is totally different from 2.4.x.
If a struct field is of string type, in 2.4.x, The generate code is like
{code}
private java.lang.String aString_ = "";
{code}
But in 2.5.0, the code is like
{code}
private java.lang.Object aString_;
{code}
And then, the inspector of class type Object is "UNKNOWN". So the exception is 
thrown.

> TestProtocolBuffersObjectInspectors fails when upgrading protobuf to 2.5.0
> --------------------------------------------------------------------------
>
>                 Key: HIVE-6219
>                 URL: https://issues.apache.org/jira/browse/HIVE-6219
>             Project: Hive
>          Issue Type: Bug
>          Components: Serializers/Deserializers
>    Affects Versions: 0.13.0
>            Reporter: Gordon Wang
>
> As Hadoop 2.2.0 is GA, the protobuf version in Hadoop 2.2.0 is protobuf 2.5.0.
> I notice that there is already a jira HIVE-5112 about protobuf upgrading. But 
> in this jira,{code} serde/if/test/complexpb.proto {code}is not generated with 
> protobuf 2.5.0.
> If we generate it with protobuf 2.5.0, then 
> TestProtocolBuffersObjectInspectors fails.
> The error message is like this
> {code}
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector  for 
> UNKNOWN
>       at 
> org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(PrimitiveObjectInspectorFactory.java:332)
>       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:192)
>       at 
> org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getReflectionObjectInspector(ObjectInspectorFactory.java:69)
>       at 
> org.apache.hadoop.hive.serde2.objectinspector.TestProtocolBuffersObjectInspectors.testProtocolBuffersObjectInspectors(TestProtocolBuffersObjectInspectors.java:40)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:601)
>       at junit.framework.TestCase.runTest(TestCase.java:168)
>       at junit.framework.TestCase.runBare(TestCase.java:134)
>       at junit.framework.TestResult$1.protect(TestResult.java:110)
>       at junit.framework.TestResult.runProtected(TestResult.java:128)
>       at junit.framework.TestResult.run(TestResult.java:113)
>       at junit.framework.TestCase.run(TestCase.java:124)
>       at junit.framework.TestSuite.runTest(TestSuite.java:243)
>       at junit.framework.TestSuite.run(TestSuite.java:238)
>       at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520)
>       at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
>       at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to