Skip to content

Commit

Permalink
[core][compute] fixed username for query execution
Browse files Browse the repository at this point in the history
The current logged in user's username was not being sent to Hive/Impala
and instead `hive` was going out. This commit fixes it and sets the
correct username.

Change-Id: I61bc4ac4545be397ca02c85c62daec74785667a6
  • Loading branch information
amitsrivastava committed Oct 4, 2023
1 parent 398e71f commit 6bd5d14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/beeswax/src/beeswax/server/dbms.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def get(user, query_server=None, cluster=None):
if query_server is None:
query_server = get_query_server_config(connector=cluster)

if not query_server.get('auth_username'):
query_server['auth_username'] = user.username

DBMS_CACHE_LOCK.acquire()
try:
DBMS_CACHE.setdefault(user.id, {})
Expand Down Expand Up @@ -331,8 +334,8 @@ def get_query_server_config_via_connector(connector):
'server_host': server_host,
'server_port': server_port,
'principal': 'TODO',
'auth_username': AUTH_USERNAME.get(),
'auth_password': AUTH_PASSWORD.get(),
'auth_username': None,
'auth_password': '',

'impersonation_enabled': impersonation_enabled,
'use_sasl': str(compute['options'].get('use_sasl', True)).upper() == 'TRUE',
Expand Down

0 comments on commit 6bd5d14

Please sign in to comment.