hive_test.py 273 B

12345678910
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. from pyhive import hive
  4. from TCLIService.ttypes import TOperationState
  5. cursor = hive.connect('localhost', 10000).cursor()
  6. print("connect ok.")
  7. cursor.execute('select count(*) from userinfo', async = False)
  8. print cursor.fetchall()