I'm connecting Hive use pyhs2. But the Hive server required Kerberos authentication. Anyone knows how to convert the JDBC string to pyhs2 parameter? Like:
jdbc:hive2://biclient2.server.163.org:10000/default;principal=hive/[email protected]?mapred.job.queue.name=default
I think it will be something like this:
pyhs2.connect(host='biclient2.server.163.org',
port=10000,
authMechanism="KERBEROS",
password="something",
user='[email protected]')
I'm also doing the same, I still not succeed, but at least having a meaningful errorcode: (Server hive/[email protected] not found in Kerberos database)
This connection string will work as long as the user running the script has a valid kerberos ticket:
import pyhs2
with pyhs2.connect(host='biclient2.server.163.org',
port=10000,
authMechanism="KERBEROS") as conn:
with conn.cursor() as cur:
print cur.getDatabases()
Username, password and any other configuration parameters are not passed through the KDC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With