簡體   English   中英

'beeline' 不被識別為內部或外部命令

[英]'beeline' is not recognized as an internal or external command

我正在嘗試使用以下代碼連接到 hive 服務器,但在嘗試從我的本地機器運行時出現錯誤:“beeline”未被識別為內部或外部命令。 相同的代碼在 Hive 服務器上運行良好。 '''

Import subprocess
Hive_Connection_URL = "jdbc:hive2://102-100-1070.stm.xyz.com:10000/default;;ssl=true;sslTrustStore=/app/bds/cloudera_truststore.jks;sslTrustPassword=;principal=hive/_HOST@BDS.xyz.COM"
target_hive_db = "test_db"
target_table_name = "test_table"
cmd = "select count(1) from " + target_hive_db + "." + target_table_name
hive_query = "beeline  -u '" + Hive_Connection_URL + "' --fastConnect=true --showHeader=false --verbose=false --showWarnings=false --silent=true  --outputformat=csv2 -e " + '"'+ cmd +'"'
val = subprocess.check_output(hive_query,shell=True)

'''

嘗試從本地計算機運行時,此代碼出錯:

'beeline' 不是內部或外部命令,也不是可運行的程序或批處理文件。

當您使用 beeline 命令的完整遠程路徑時?

看起來beeline可執行文件不在您的 PC 路徑中。 這是添加它的方法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM