-2

I am trying to connect to hive server using below code but getting error when trying to run from my LOCAL Machine: 'beeline' is not recognized as an internal or external command. Same code is working fine from Hive Server. '''

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)

'''

This code is giving error when trying to run from my local machine:

'beeline' is not recognized as an internal or external command, operable program or batch file.

Rohit
  • 97
  • 1
  • 2
  • 9

2 Answers2

0

and when you use the full remote path to the beeline command?

Ruben
  • 192
  • 1
  • 2
  • 10
0

Looks like the beeline executable is not in your path on your PC. Here's how you can add it.

youessbeesee
  • 26
  • 1
  • 2