I am trying to access hive using pyhs2. I tried the following code:
example.py
import pyhs2
conn = pyhs2.connect(host='localhost', port=10000, user=None, password=None,database='default')
with conn.cursor() as new_cur:
new_cur.execute("select * from table")
for i in new_cur.fetch():
print i
I am getting the following error:
Traceback (most recent call last):
File "example.py", line 2, in <module> conn = pyhs2.connect(host='localhost', port=10000,user=None, password=None,database='default')
thrift.transport.TTransport.TTransportException: Could not connect to localhost:10000