Member since
03-27-2020
5
Posts
1
Kudos Received
0
Solutions
11-25-2020
09:14 AM
Yes it's a big SIGH!!! I've tried 10s and 20s of different connection strings from trying to install older verison of Python (3.7.4) so I can install sasl and pyhive and basically everything I could find out there but it's still not working yet. So, basically my setup is HIVE on Azure and the DB connections have server/host something like this "<server>.azurehdinsight.net" with port of 443. I'm using DBeaver to connect to the HIVE db and it's using JDBC URL - complete URL is something like this "jdbc:hive2://<server>.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2", so can someone please help me out with what packages I need in order for me to successfully query HIVE from Python? @pudnik26354 - can you please post what worked for you? Thank you so much.
... View more
05-19-2020
08:09 AM
1 Kudo
I think it was because if you use kerberos, the kerberos credentials have to be in upper case because they are case sensitive
... View more
03-30-2020
09:54 AM
The DSN-less connection string below FINALLY worked for me, in windows 10. I created a file DSN, then copy/pasted the string into the python code, as a template. Three lessons that I learned from this struggle: 1) kerberos is CASE SENSITIVE. Your kerberos realm in the string MUST be uppercase. 2) The Cloudera driver doesn't like spaces in between the semicolons in the string. Avoid them. 3) If you don't need connection pooling, turn it off with a pyodbc.pooling = False statement. import pyodbc strFileDSNAsAstring = "DRIVER=Cloudera ODBC Driver for Apache Hive;USEUNICODESQLCHARACTERTYPES=1; \ SSL=0;SERVICEPRINCIPALCANONICALIZATION=0;SERVICEDISCOVERYMODE=0;SCHEMA=database;PORT=port; \ KRBSERVICENAME=hive;KRBREALM=uppercaserealm;KRBHOSTFQDN=hostfqdndomain;INVALIDSESSIONAUTORECOVER=1; \ HOST=host;HIVESERVERTYPE=2;GETTABLESWITHQUERY=0;ENABLETEMPTABLE=0;DESCRIPTION=Hive; \ DELEGATEKRBCREDS=0;AUTHMECH=1;ASYNCEXECPOLLINTERVAL=100;APPLYSSPWITHQUERIES=1;CAIssuedCertNamesMismatch=1;" try: pyodbc.pooling = False conn = pyodbc.connect(strFileDSNAsAstring, autocommit=True) except: print("failure.") else: conn.close() print("success.")
... View more