title: Hive Server 2 error on python connect with hiveserver2
body: <p>I am using </p>
  
  <p>Centos , Python2.7 , hive 2.1 ,Hadoop 2.7.2 ,pyHive</p>
  
  <p>here is code </p>
  
  <pre><code>from pyhive import hive
  from TCLIService.ttypes import TOperationState
  cursor = hive.connect('localhost').cursor()
  cursor.execute('SELECT * FROM my_awesome_data LIMIT 10', async=True)
  
  #status = cursor.poll().operationState
  #while status in (TOperationState.INITIALIZED_STATE, TOperationState.RUNNI$
  #    logs = cursor.fetch_logs()
  #    for message in logs:
  #        print message
  
  # If needed, an asynchronous query can be cancelled at any time with:
  # cursor.cancel()
  
  # status = cursor.poll().operationState
  
  #print cursor.fetchall()
  </code></pre>
  
  <p>when I run python /usr/local/py/test5.py in terminal its showing ....</p>
  
  <pre><code>Traceback (most recent call last):
  File "/usr/local/py/test5.py", line 3, in &lt;module&gt;
  cursor = hive.connect('localhost').cursor()
  File "/usr/local/lib/python2.7/site-packages/pyhive/hive.py", line 63, in connect
  return Connection(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pyhive/hive.py", line 104, in __init__
  self._transport.open()
  File "/usr/local/lib/python2.7/site-packages/thrift_sasl/__init__.py", line 80, in open
  status, payload = self._recv_sasl_message()
  File "/usr/local/lib/python2.7/site-packages/thrift_sasl/__init__.py", line 98, in _recv_sasl_message
  header = read_all_compat(self._trans, 5)
  File "/usr/local/lib/python2.7/site-packages/thrift_sasl/six.py", line 31, in &lt;lambda&gt;
  read_all_compat = lambda trans, sz: trans.readAll(sz)
  File "/usr/local/lib/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
  chunk = self.read(sz - have)
  File "/usr/local/lib/python2.7/site-packages/thrift/transport/TSocket.py", line 120, in read
  message='TSocket read 0 bytes')
  thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
  </code></pre>
  
  <p>Hive server error log showing after this...</p>
  
  <pre><code>ERROR [HiveServer2-Handler-Pool: Thread-41]: server.TThreadPoolServer (:()) - Thrift error occur$
  org.apache.thrift.protocol.TProtocolException: Missing version in readMessageBegin, old client?
      at    org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:228)
      at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27)
      at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
      at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Also I had tried <a href="https://github.com/BradRuderman/pyhs2" rel="nofollow">pyhs2</a> getting same error </p>
  
  <p>what was going wrong ?</p>
  
  <p>Thanks</p>