0

I am trying to establish a connection to the impala database through a Python script using a keytab instead the normal user/password combination, but am unable to find any tutorials online whatsoever, the code I am currently using is:

conn = connect(host=impala_host, port=impala_port, use_ssl=True, auth_mechanism="PLAIN", user=username, password=pwd, database=impala_db)
cursor = conn.cursor() 

However, I want to connect using keytab instead of my password.

double-beep
  • 5,031
  • 17
  • 33
  • 41

1 Answers1

0

It appears that you are trying to use that library: https://github.com/cloudera/impyla

Please have a look at Usage section in README.md there:

from impala.dbapi import connect
conn = connect(host='my.host.com', port=21050)
cursor = conn.cursor()
cursor.execute('SELECT * FROM mytable LIMIT 100')
print cursor.description  # prints the result set's schema
results = cursor.fetchall()
...
...
void
  • 1,343
  • 11
  • 26
  • The above code works fine, what i am trying is to replace the password section with a keytab file so that i don't have to connect by hardcoding in my password – Ashish Kumar Singh Mar 28 '19 at 09:35
  • @AshishKumarSingh maybe you could find something useful here? https://stackoverflow.com/questions/34977562/connect-to-impala-using-impyla-client-with-kerberos-auth – void Mar 28 '19 at 14:05