I found a solution. In testing, I tried out the HTTPClientTransport that's now supported for Thrift in Hive 0.12. This required me to set the Hive conf var hive.server2.enable.doAs to false in order for it to work. When I reverted back to using the BufferedTransport, with this property in my hive-site.xml, I found the Thrift interface no longer threw ClassCastExceptions.
I have no idea if this is a bug, or by design. On 21 October 2013 11:54, David Morel <david.mo...@amakuru.net> wrote: > We have it working fine with hive 0.11, not tested with 0.12. I'll have a > look this week. > > David Morel > > > On 21 octobre 2013 at 11:57:03, Andy Sykes > (andy.sy...@forward3d.com<//andy.sy...@forward3d.com>) > wrote: > > I can report I see this same error when working with the Perl thrift Hive > client ( > http://search.cpan.org/~dmor/Thrift-API-HiveClient2-0.011/lib/Thrift/API/HiveClient2.pm), > and with the newly released Hive 0.12.0. > > Is anyone successfully using Hiveserver2, or do I have something odd in my > environment? > > > On 14 October 2013 17:44, Andy Sykes <andy.sy...@forward3d.com> wrote: > >> Hi there, >> >> We're using the rbhive gem (https://github.com/forward3d/rbhive) to >> connect to the Hiveserver2 Thrift service running on Hive 0.11. >> >> I've turned SASL auth off with the following in hive-site.xml: >> >> <property> >> <name>hive.server2.authentication</name> >> <value>NOSASL</value> >> </property> >> >> When I connect, I get the following stack trace in the Hiveserver2 logs: >> >> 13/10/14 17:42:17 ERROR server.TThreadPoolServer: Error occurred during >> processing of message. >> java.lang.ClassCastException: org.apache.thrift.transport.TSocket cannot >> be cast to org.apache.thrift.transport.TSaslServerTransport >> at >> org.apache.hive.service.auth.TUGIContainingProcessor.process(TUGIContainingProcessor.java:35) >> at >> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) >> at java.lang.Thread.run(Thread.java:662) >> >> This didn't happen with Hive 0.10 - we could connect with SASL turned off >> without a problem. >> >> Can anyone shed any light on this? >> >> -- >> *Andy Sykes* >> DevOps Engineer >> >> +4420 7806 5904 >> +4475 9005 2109 >> >> 19 Mandela Street >> Floor 2, Centro 3 >> London >> NW1 0DU >> >> Privacy & Email Policy <http://forward3d.com/terms.html> >> > > > > -- > *Andy Sykes* > DevOps Engineer > > +4420 7806 5904 > +4475 9005 2109 > > 19 Mandela Street > Floor 2, Centro 3 > London > NW1 0DU > > Privacy & Email Policy <http://forward3d.com/terms.html> > > -- *Andy Sykes* DevOps Engineer +4420 7806 5904 +4475 9005 2109 19 Mandela Street Floor 2, Centro 3 London NW1 0DU Privacy & Email Policy <http://forward3d.com/terms.html>