public static HivePrincipalType getHivePrincipalType(PrincipalType type) throws HiveException {
    if (type == null) {
      return null;
    }
    switch(type){
    case USER:
      return HivePrincipalType.USER;
    case ROLE:
      return HivePrincipalType.ROLE;
    case GROUP:
      return HivePrincipalType.GROUP;
    default:
      //should not happen as we take care of all existing types
      throw new AssertionError("Unsupported authorization type specified");
    }
  }
Convert thrift principal type to authorization plugin principal type
@param type - thrift principal type
@return
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java