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

Fang-Yu Rao commented on IMPALA-14364:
--------------------------------------

It looks like when instantiating an ImpylaHS2Connection in 
[https://github.com/apache/impala/blob/master/tests/common/impala_connection.py],
 we could specify the value of '{*}collect_profile_and_log{*}' to set up the 
field '_collect_profile_and_log' of the {*}ImpylaHS2Connection{*}.

 

'_collect_profile_and_log' will in turn be used to determine whether to get the 
runtime/query profile in __fetch_results().
{code:java}
      if self._collect_profile_and_log:
        log = self.get_log(handle)
        profile = self.get_runtime_profile(handle, 
profile_format=profile_format)
{code}
 

So I think the fix would be to allow a user to provide the value of 
'collect_profile_and_log' when using create_impala_client() in 
[https://github.com/apache/impala/blob/master/tests/common/impala_test_suite.py]
 to create an Impala client.

 

This is not an issue when authorization is not enabled so very few developers 
would really care about this.

> __fetch_results_and_profile() in impala_connection.py always fetches query 
> profile even though fetch_profile_after_close is False
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-14364
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14364
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Fang-Yu Rao
>            Priority: Major
>
> It seems __fetch_results_and_profile() in 
> [impala_connection.py|https://github.com/apache/impala/blame/master/tests/common/impala_connection.py]
>  always fetches query profile even though 'fetch_profile_after_close' is set 
> to False by default.
> {code}
> tests/common/impala_connection.py:692: in execute                             
>                                                                               
>                          
>     fetch_exec_summary=fetch_exec_summary, profile_format=profile_format)     
>                                                                               
>                          
> tests/common/impala_connection.py:705: in __fetch_results_and_profile         
>                                                                               
>                          
>     profile_format=profile_format)                                            
>                                                                               
>                          
> tests/common/impala_connection.py:884: in __fetch_results                     
>                                                                               
>                          
>     profile = self.get_runtime_profile(handle, profile_format=profile_format) 
>                                                                               
>                          
> tests/common/impala_connection.py:796: in get_runtime_profile                 
>                                                                               
>                          
>     return cursor.get_profile(profile_format=profile_format)                  
>                                                                               
>                          
> infra/python/env-gcc10.4.0/lib/python2.7/site-packages/impala/hiveserver2.py:723:
>  in get_profile                                                               
>                       
>     return self._last_operation.get_profile(profile_format=profile_format)    
>                                                                               
>                          
> infra/python/env-gcc10.4.0/lib/python2.7/site-packages/impala/hiveserver2.py:1478:
>  in get_profile                                                               
>                      
>     resp = self._rpc('GetRuntimeProfile', req, True)                          
>                                                                               
>                          
> infra/python/env-gcc10.4.0/lib/python2.7/site-packages/impala/hiveserver2.py:1181:
>  in _rpc                                                                      
>                      
>     err_if_rpc_not_ok(response)                                               
>                                                                               
>                          
> infra/python/env-gcc10.4.0/lib/python2.7/site-packages/impala/hiveserver2.py:867:
>  in err_if_rpc_not_ok                                                         
>                       
>     raise HiveServer2Error(resp.status.errorMessage)                          
>                                                                               
>                          
> E   HiveServer2Error: Query 08433dc2db06b027:1832788200000000 failed:         
>                                                                               
>                          
> E   User non_owner is not authorized to access the runtime profile or 
> execution summary.
> {code}
> This could/would be a problem if a user is authorized to SELECT a view but 
> not the referenced table(s)/view(s) by the view. In such a case, we expect 
> the execution of the query to be successful but execute() throws an exception.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to