Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Impala connection issue while enables LDAP #3516

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Impala connection issue while enables LDAP, and upgrade impyla to…
… latest version
  • Loading branch information
DeanThompson committed Mar 2, 2019
commit 6c3d6a8a7a59a09ded146ea53c50d43a83169e03
14 changes: 13 additions & 1 deletion redash/query_runner/impala_ds.py
Original file line number Diff line number Diff line change
@@ -90,11 +90,23 @@ def _get_tables(self, schema_dict):

return schema_dict.values()

def _connect_to_impala(self):
params = self.configuration.to_dict().copy()
params['user'] = params.pop('ldap_user', None)
params['password'] = params.pop('ldap_password', None)

# The auth_mechanism should be 'PLAIN' instead of 'LDAP'
# if the Impalad enables LDAP auth.
# Check https://github.com/cloudera/impyla/issues/290 for more details.
if params.pop('use_ldap', False):
params['auth_mechanism'] = 'PLAIN'
return connect(**params)

def run_query(self, query, user):

connection = None
try:
connection = connect(**self.configuration.to_dict())
connection = self._connect_to_impala()

cursor = connection.cursor()

4 changes: 2 additions & 2 deletions requirements_all_ds.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
google-api-python-client==1.5.1
gspread==0.6.2
impyla==0.10.0
impyla==0.14.2.2
influxdb==2.7.1
MySQL-python==1.2.5
oauth2client==3.0.0
@@ -14,7 +14,7 @@ dynamo3==0.4.7
boto3==1.9.85
botocore==1.12.85
sasl>=0.1.3
thrift>=0.8.0
thrift==0.11.0
thrift_sasl>=0.1.0
cassandra-driver==3.11.0
memsql==2.16.0