[
https://issues.apache.org/jira/browse/HIVE-26095?focusedWorklogId=750893&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-750893
]
ASF GitHub Bot logged work on HIVE-26095:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 31/Mar/22 10:33
Start Date: 31/Mar/22 10:33
Worklog Time Spent: 10m
Work Description: zabetak commented on a change in pull request #3156:
URL: https://github.com/apache/hive/pull/3156#discussion_r839446442
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/hooks/QueryLifeTimeHookContextImpl.java
##########
@@ -78,11 +88,12 @@ public Builder withHookContext(HookContext hc) {
return this;
}
- public QueryLifeTimeHookContextImpl build() {
+ public QueryLifeTimeHookContextImpl build(String queryId) {
QueryLifeTimeHookContextImpl queryLifeTimeHookContext = new
QueryLifeTimeHookContextImpl();
queryLifeTimeHookContext.setHiveConf(this.conf);
queryLifeTimeHookContext.setCommand(this.command);
queryLifeTimeHookContext.setHookContext(this.hc);
+ queryLifeTimeHookContext.queryId = Objects.requireNonNull(queryId);
Review comment:
We can enforce a min length check but its not easy to have a max since
the query id includes the user name. The username max length is OS dependent.
I added a few more checks in
https://github.com/apache/hive/pull/3156/commits/aae20a1fd3e9ae289daa3e6c95c20ae8a209211f.
These are mostly sanity checks. I don't think we should put very involved
checks here. Asserting things for the shape of the query id should be done via
unit tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 750893)
Time Spent: 40m (was: 0.5h)
> Add queryid in QueryLifeTimeHookContext
> ---------------------------------------
>
> Key: HIVE-26095
> URL: https://issues.apache.org/jira/browse/HIVE-26095
> Project: Hive
> Issue Type: New Feature
> Components: Hooks
> Reporter: Stamatis Zampetakis
> Assignee: Stamatis Zampetakis
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0-alpha-2
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> A
> [QueryLifeTimeHook|https://github.com/apache/hive/blob/6c0b86ef0cfc67c5acb3468408e1d46fa6ef8024/ql/src/java/org/apache/hadoop/hive/ql/hooks/QueryLifeTimeHook.java]
> is executed various times in the life-cycle of a query but it is not always
> possible to obtain the id of the query. The query id is inside the
> {{HookContext}} but the latter is not always available notably during
> compilation.
> The query id is useful for many purposes as it is the only way to uniquely
> identify the query/command that is currently running. It is also the only way
> to match together events appearing in before and after methods.
> The goal of this jira is to add the query id in
> [QueryLifeTimeHookContext|https://github.com/apache/hive/blob/6c0b86ef0cfc67c5acb3468408e1d46fa6ef8024/ql/src/java/org/apache/hadoop/hive/ql/hooks/QueryLifeTimeHookContext.java]
> and make it available during all life-cycle events.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)