Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ private SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res
throws HiveSQLException, IOException {
final String ipAddress = getIpAddress();

LOG.info("Creating Hive session handle for user [{}] from IP {}", req.getUsername(), ipAddress);
LOG.info("Creating Hive session handle for user [{}] from IP {}", userName, ipAddress);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we do if req.getUsername() is null then log userName

@owenmonn owenmonn Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fallback already exists in getUserName(), in the opposite direction:

if (userName == null) {
  userName = req.getUsername();
}

So adding a null check would only change behaviour when both are set, and there the raw value wins and we lose the shortname handling and the getProxyUser() result.

Whereas getUserName() is documented as "Returns the effective username", and that value is what the session is opened with.


TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION,
req.getClient_protocol());
Expand Down
Loading