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: Ifd8dbc8d716dfe2000fbfa8121e39f2610051fa1
  • Loading branch information
amitsrivastava committed Oct 4, 2023
1 parent 6bd5d14 commit c5374cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/beeswax/src/beeswax/server/dbms.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +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'):
# if the auth_username is not set then we attempt to set using the current user
# this is likely to be the case when using connectors/computes
if not query_server.get('auth_username') and user and user.username:
query_server['auth_username'] = user.username

DBMS_CACHE_LOCK.acquire()
Expand Down Expand Up @@ -333,6 +335,8 @@ def get_query_server_config_via_connector(connector):
'server_name': compute_name,
'server_host': server_host,
'server_port': server_port,
# For connectors/computes, the auth details are not available
# from configs and needs patching before submitting requests
'principal': 'TODO',
'auth_username': None,
'auth_password': '',
Expand Down

0 comments on commit c5374cb

Please sign in to comment.