hadoop - Second Hive Query is not fetching the results in Python 2.6.6 -
python version 2.6.6. following code connecting hive , fetching records 2 different tables of same database:
import pyhs2 db = pyhs2.connect(host='10.11.12.35', port=10000, authmechanism="plain", user='hive', password='', database='sumit') cursor=db.cursor() # record table1 cursor.execute("select * student id=1") resultstable1 = cursor.fetchall() row in resultstable1: print "table 1: ", row # record table2 print "trying execute second hive query" cursor.execute("select * student1 id=1") resultstable2 = cursor.fetchall() print "trying enter loop" row in resultstable2: print "table 2: ", row
when execute code o/p below:
table 1: [1, 'justin', 'morrison'] trying execute second hive query trying enter loop
the first query returning o/p second hive query not returning or not executing @ all, don't know! please in getting records both tables.
note have valid data in both tables "student" , "student1".
thanks in advance!
Comments
Post a Comment