You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Guillermo Alvarado <gu...@gmail.com> on 2013/08/19 19:47:22 UTC

Invalid method name: 'execute'

Hi everyone,

I am using the Python client
https://cwiki.apache.org/Hive/hiveclient.html#HiveClient-Python to execute
some queries to Hive, I am getting this error:


Traceback (most recent call last):
  File "test_hive.py", line 20, in <module>
    client.execute("SHOW TABLES")
  File "/tmp/hive/build/dist/lib/py/hive_service/ThriftHive.py", line 68,
in execute
    self.recv_execute()
  File "/tmp/hive/build/dist/lib/py/hive_service/ThriftHive.py", line 84,
in recv_execute
    raise x
thrift.Thrift.TApplicationException: Invalid method name: 'execute'

and this is my code:

import sys

from hive_service import ThriftHive
from hive_service.ttypes import HiveServerException
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol

transport = TSocket.TSocket('x.x.x.x', 8002)
transport = TTransport.TBufferedTransport(transport)
protocol = TBinaryProtocol.TBinaryProtocol(transport)

client = ThriftHive.Client(protocol)
transport.open()
#import pdb; pdb.set_trace()
client.execute("SHOW TABLES")
print client.fetchAll()
transport.close()


Anybody have an Idea what is wrong? I am using a CDH4 cluster.

Thanks in advance,
Regards.