Python Hive Client pyhs2: How to return results from a select statement? -
below code:
import pyhs2 pyhs2.connect(host='localhost', port=10000, authmechanism="plain", user='biuser', password='biuser', database='default') conn: conn.cursor() cur: #execute query cur.execute("select * some_table") print "executed" #fetch table results in cur.fetch(): print
this above code continues run after printing "executed" no end in sight! supposed take time? other executions getting various database names , getting table names don't take time. how capture results of select statement here?
this should work you; replace loop with:
while cur.hasmorerows: print cur.fetchone()
Comments
Post a Comment