[ 
https://issues.apache.org/jira/browse/HIVE-28019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17837401#comment-17837401
 ] 

Ramesh Kumar Thangarajan commented on HIVE-28019:
-------------------------------------------------

Hi [~zabetak] First of all, thank you very much for the review on this. :)

I am with you on the fact that HiveOperation was introduced for authorization 
and may be we should not change it to represent the query type. But I still 
believe we should do the change for PREHOOK: type: and POSTHOOK: type: and also 
the HiveProtoLoggingHook.

I feel that the change to HiveOperation.Explain for the explain queries is 
needed mostly because we use the HiveOperation to print in the preexecute and 
postexecute actions.

[https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/hooks/PreExecutePrinter.java#L69]

At present we report the type information for the queries in preexec and 
postexec as below:

PREHOOK: type: QUERY

POSTHOOK: type: QUERY

I think this is the query type information that is reported along with other 
information on the query. If that is the case I feel we should not report other 
type for explain queries. If this change is loss of information shouldn't the 
usage of type wrong by the users? 

Although we can skip this and fix only the HiveProtoLoggingHook to address 
right query type, I feel we will report two different information for the same 
query in different places. Also keeping them synchronized will help us in the 
complete testing for all types of queries.

Please let me know if you think my points make sense. I will address to not 
touch the commandType and rather create a field to represent explain queries 
and use that to report the correct query type in HiveProtoLoggingHook and the 
PREHOOK: type: and POSTHOOK: type.

> Fix query type information in proto files for load and explain queries
> ----------------------------------------------------------------------
>
>                 Key: HIVE-28019
>                 URL: https://issues.apache.org/jira/browse/HIVE-28019
>             Project: Hive
>          Issue Type: Task
>          Components: HiveServer2
>            Reporter: Ramesh Kumar Thangarajan
>            Assignee: Ramesh Kumar Thangarajan
>            Priority: Major
>              Labels: pull-request-available
>
> Certain query types like LOAD, export, import and explain queries did not 
> produce the right Hive operation type



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to