I am trying to get the query result from thrift api using a java program
which use thrifthive client to execute a query but I am getting exception

org.apache.thrift.TApplicationException: Invalid method name: 'execute'
at
org.apache.thrift.TApplicationException.read(TApplicationException.java:111)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71)
at
org.apache.hadoop.hive.service.ThriftHive$Client.recv_execute(ThriftHive.java:116)
at
org.apache.hadoop.hive.service.ThriftHive$Client.execute(ThriftHive.java:103)
at
com.rajkrrsingh.thrift.test.HiveThriftClientExample.main(HiveThriftClientExample.java:23)

this is the snippet of the program

      TSocket tSocket = new TSocket("hostname",10000);
TProtocol tProtocol = new TBinaryProtocol(tSocket);
Client client = new Client(tProtocol);
try {
tSocket.open();
System.out.println(tSocket.isOpen());
client.execute("use default");
client.execute("show tables");
List<String> rs = client.fetchAll();

Any Idea what going wrong here

Reply via email to