configure pyhive from beeline

357 Views Asked by At

I'm on a machine where beeline exists and works with the command

beeline -u "jdbc:hive2://bdm05:10000/test;principal=hive/_HOST@BIGDATA-INT" -n myuser

I would need to use python and pyhive in order to handle tables with pandas.

from pyhive import hive
    
conn = hive.Connection(
        host = "jdbc:hive2://bdm05:10000/test;principal=hive/_HOST@BIGDATA-INT",
        port = 10000,
        username = myuser,
        database = 'test')
    
    Traceback (most recent call last):
              File "<stdin>", line 9, in <module>
              File "/usr/local/lib/python2.7/dist-packages/pyhive/hive.py", line 86, in __init__
                self._transport.open()
              File "/usr/local/lib/python2.7/dist-packages/thrift_sasl/__init__.py", line 61, in open
                self._trans.open()
              File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 101, in open
                message=message)
            thrift.transport.TTransport.TTransportException: Could not connect to jdbc:hive2://bdm05:10000/test;principal=hive/_HOST@BIGDATA-INT:10000

What exatly is the pyhive syntax starting from the beeline command?

0

There are 0 best solutions below