[
https://issues.apache.org/jira/browse/HIVE-26789?focusedWorklogId=830359&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-830359
]
ASF GitHub Bot logged work on HIVE-26789:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Dec/22 14:34
Start Date: 01/Dec/22 14:34
Worklog Time Spent: 10m
Work Description: deniskuzZ commented on code in PR #3813:
URL: https://github.com/apache/hive/pull/3813#discussion_r1037177772
##########
cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java:
##########
@@ -250,12 +250,13 @@ CommandProcessorResponse processLocalCmd(String cmd,
CommandProcessor proc, CliS
}
// Set HDFS CallerContext to queryId and reset back to sessionId after
the query is done
-
ShimLoader.getHadoopShims().setHadoopQueryContext(qp.getQueryState().getQueryId());
+ ShimLoader.getHadoopShims()
+ .setHadoopQueryContext(qp.getQueryState().getQueryId() + "_User:"
+ ss.getUserName());
Review Comment:
can we extract "_User:" literal into a constant or have a pattern for
String.format() ?
````
String USER_ID = "%s_User:%s"
String.format(USER_ID, queryState.getQueryId(),
parentSessionState.getUserName())
````
Issue Time Tracking
-------------------
Worklog Id: (was: 830359)
Time Spent: 1h 50m (was: 1h 40m)
> Add UserName in CallerContext for queries
> -----------------------------------------
>
> Key: HIVE-26789
> URL: https://issues.apache.org/jira/browse/HIVE-26789
> Project: Hive
> Issue Type: Improvement
> Reporter: Ayush Saxena
> Assignee: Ayush Saxena
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> HDFS Audit logs if impersonation is false, tracks only the Hive user in the
> audit log, Can pass the actual user as part of the CallerContext, so that can
> be logged as well for better tracking
--
This message was sent by Atlassian Jira
(v8.20.10#820010)