liangyu-1 commented on PR #4711:
URL: https://github.com/apache/hive/pull/4711#issuecomment-1724726077

   > There is a logic insider getHiveException()
   > 
   > ```
   >     if (e.getMessage() != null) {
   >       hiveErrMsg = String.format("%s%s%s", msg, ": ",
   >           
Splitter.on(System.getProperty("line.separator")).split(e.getMessage()).iterator()
   >               .next());
   >     } else {
   >       hiveErrMsg = msg;
   >     }
   > ```
   > 
   > Why this doesn't kick in? Can you extend a test case as well. I guess this 
case is handled via 
[HIVE-16960](https://issues.apache.org/jira/browse/HIVE-16960)
   
   @ayushtkn 
   These two cases might be a little different, because the ErrorMsg returned 
from these cases are different.
   
   ```  
   public static ErrorMsg getErrorMsg(Exception e) {
       if (e instanceof AccessControlException) {
         return ACCESS_DENIED;
       }
       if (e instanceof NSQuotaExceededException) {
         return QUOTA_EXCEEDED;
       }
       if (e instanceof DSQuotaExceededException) {
         return QUOTA_EXCEEDED;
       }
       if (e instanceof UnresolvedPathException) {
         return UNRESOLVED_PATH;
       }
       if (e instanceof FileNotFoundException) {
         return FILE_NOT_FOUND;
       }
       return UNRESOLVED_RT_EXCEPTION;
     }
   ```
   In case [HIVE-16960](https://issues.apache.org/jira/browse/HIVE-16960), the 
Exception is the instance of AccessControlException so the ErrorMsg returned is 
`ACCESS_DENIED`, then hiveErrMsg will be showed to users.
   
    But in my case the Exception is HiveException, which cannot be found in the 
exception list, and ErrorMsg returned will be `UNRESOLVED_RT_EXCEPTION`. Then 
the hiveErrMsg will not be showed. 
   
   I will try to reproduce this issue in test cases.
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to