[ https://issues.apache.org/jira/browse/HIVE-3266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416782#comment-13416782 ]
Travis Crawford commented on HIVE-3266: --------------------------------------- The following exception is thrown on trunk when trying to read a "binary" field through ThriftDeserializer: {code} 2012-07-18 00:45:49,532 ERROR CliDriver (SessionState.java:printError(400)) - Failed with exception java.io.IOException:java.lang.ClassCastExceptio n: [B cannot be cast to org.apache.hadoop.hive.serde2.lazy.ByteArrayRef java.io.IOException: java.lang.ClassCastException: [B cannot be cast to org.apache.hadoop.hive.serde2.lazy.ByteArrayRef at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:173) at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1375) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:270) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:412) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:750) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:613) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.RunJar.main(RunJar.java:186) Caused by: java.lang.ClassCastException: [B cannot be cast to org.apache.hadoop.hive.serde2.lazy.ByteArrayRef at org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaBinaryObjectInspector.getPrimitiveWritableObject(JavaBinaryObjectInspector.java:48) at org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(SerDeUtils.java:276) at org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(SerDeUtils.java:349) at org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(SerDeUtils.java:219) at org.apache.hadoop.hive.serde2.DelimitedJSONSerDe.serializeField(DelimitedJSONSerDe.java:59) at org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.serialize(LazySimpleSerDe.java:365) at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:163) ... 11 more {code} Here we see the object is already a byte[], but we're trying to use it as a ByteArrayRef. A small patch handles this case. > Hive queries over thrift binary fields fail > ------------------------------------------- > > Key: HIVE-3266 > URL: https://issues.apache.org/jira/browse/HIVE-3266 > Project: Hive > Issue Type: Bug > Reporter: Travis Crawford > Assignee: Travis Crawford > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira