You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "liangyu-1 (via GitHub)" <gi...@apache.org> on 2023/09/19 02:08:13 UTC

[GitHub] [hive] liangyu-1 commented on pull request #4711: HIVE-27688 hive MoveTask cannot show the correct exception message

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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org