From 64acd69b1f47bf171cec11f013e9bf69320e77e4 Mon Sep 17 00:00:00 2001 From: Amit Srivastava Date: Wed, 16 Oct 2024 14:45:53 -0700 Subject: [PATCH] use the system username for impala/hive auth from configs --- apps/beeswax/src/beeswax/server/dbms.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/beeswax/src/beeswax/server/dbms.py b/apps/beeswax/src/beeswax/server/dbms.py index c25c220540a..a5f77f9f5fd 100644 --- a/apps/beeswax/src/beeswax/server/dbms.py +++ b/apps/beeswax/src/beeswax/server/dbms.py @@ -355,6 +355,13 @@ def get_query_server_config_via_connector(connector): else: impersonation_enabled = hiveserver2_impersonation_enabled() + if compute['dialect'] == 'impala': + from impala import conf as dbms_conf + else: + from beeswax import conf as dbms_conf + auth_username = dbms_conf.AUTH_USERNAME.get() + auth_password = dbms_conf.AUTH_PASSWORD.get() + return { 'is_compute': True, 'dialect': compute['dialect'], @@ -364,8 +371,8 @@ def get_query_server_config_via_connector(connector): # For connectors/computes, the auth details are not available # from configs and needs patching before submitting requests 'principal': 'TODO', - 'auth_username': compute['options'].get('auth_username'), - 'auth_password': compute['options'].get('auth_password', 'hue'), + 'auth_username': compute['options'].get('auth_username', auth_username), + 'auth_password': compute['options'].get('auth_password', auth_password), 'impersonation_enabled': impersonation_enabled, 'use_sasl': str(compute['options'].get('use_sasl', True)).upper() == 'TRUE',