我試圖連接在本地使用Python從窗戶蜂巢:下面是我使用的代碼:嘗試通過在python中使用pyhs2連接到配置單元|錯誤:ModuleNotFoundError:無模塊名爲「Cloudera的」
import pyhs2 as hive
DEFAULT_DB = 'default'
DEFAULT_SERVER = '10.37.40.1'
DEFAULT_PORT = 10000
DEFAULT_DOMAIN = 'PAM01-PRD01.IBM.COM'
u = "username"
s = "password"
# Build the Hive Connection
connection = hive.connect(host=DEFAULT_SERVER, port= DEFAULT_PORT, user=u + '@' + DEFAULT_DOMAIN, password=s)
# Hive query statement
statement = "select * from user_yuti.Temp_CredCard where pir_post_dt = '2014-05-01' limit 100"
cur = connection.cursor()
# Runs a Hive query and returns the result as a list of list
cur.execute(statement)
df = cur.fetchall()
,並通過CMD執行該腳本:
python hive-connection-test.py
做傢伙有曾經發生在這裏的任何想法!它們不是python軟件包中稱爲cloudera的軟件包,我已經搜索過它。
感謝您的努力亞當..讚賞 –