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

Yongzhi Chen commented on HIVE-8529:
------------------------------------

HS2 provide two fetch types when fetchResult: Query_Output and LOG. When 
hive.server2.logging.operation.enabled is false, it is normal behavior that HS2 
throw exception when client try to fetchResult using LOG. The problem here is 
that in hive jdbc getQueryLog method, it just blindly call FetchResult method 
with fetchType LOG without checking if server enable logging or not. 
Fix this issue by checking before call FetchResult. 

> HiveSessionImpl#fetchResults should not try to fetch operation log when 
> hive.server2.logging.operation.enabled is false.
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-8529
>                 URL: https://issues.apache.org/jira/browse/HIVE-8529
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, JDBC
>            Reporter: Vaibhav Gumashta
>            Assignee: Yongzhi Chen
>
> Throws this even when it is disabled:
> {code}
> 14/10/20 15:53:14 [HiveServer2-Handler-Pool: Thread-53]: DEBUG 
> security.UserGroupInformation: PrivilegedActionException as:vgumashta 
> (auth:SIMPLE) cause:org.apache.hive.service.cli.HiveSQLException: Couldn't 
> find log associated with operation handle: OperationHandle 
> [opType=EXECUTE_STATEMENT, 
> getHandleIdentifier()=b3d05ca6-e3e8-4bef-b869-0ea0732c3ac5]
> 14/10/20 15:53:14 [HiveServer2-Handler-Pool: Thread-53]: WARN 
> thrift.ThriftCLIService: Error fetching results: 
> org.apache.hive.service.cli.HiveSQLException: Couldn't find log associated 
> with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, 
> getHandleIdentifier()=b3d05ca6-e3e8-4bef-b869-0ea0732c3ac5]
>       at 
> org.apache.hive.service.cli.operation.OperationManager.getOperationLogRowSet(OperationManager.java:240)
>       at 
> org.apache.hive.service.cli.session.HiveSessionImpl.fetchResults(HiveSessionImpl.java:665)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at 
> org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:79)
>       at 
> org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:37)
>       at 
> org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:64)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:394)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
>       at 
> org.apache.hadoop.hive.shims.HadoopShimsSecure.doAs(HadoopShimsSecure.java:508)
>       at 
> org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:60)
>       at com.sun.proxy.$Proxy20.fetchResults(Unknown Source)
>       at 
> org.apache.hive.service.cli.CLIService.fetchResults(CLIService.java:427)
>       at 
> org.apache.hive.service.cli.thrift.ThriftCLIService.FetchResults(ThriftCLIService.java:582)
>       at 
> org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1553)
>       at 
> org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1538)
>       at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>       at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>       at 
> org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
>       at 
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>       at java.lang.Thread.run(Thread.java:695)
> 14/10/20 15:53:14 [HiveServer2-Handler-Pool: Thread-53]: DEBUG 
> transport.TSaslTransport: writing data length: 2525
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to