private static HivePrivilegeObjectType getHiveObjType(HiveObjectType type) throws HiveException {
    if (type == null) {
      return null;
    }
    switch(type){
      case GLOBAL:
        if (SessionState.get().getAuthorizationMode() == SessionState.AuthorizationMode.V2) {
          throw new HiveException(ErrorMsg.UNSUPPORTED_AUTHORIZATION_RESOURCE_TYPE_GLOBAL);
        }
        return HivePrivilegeObjectType.GLOBAL;
      case DATABASE:
        return HivePrivilegeObjectType.DATABASE;
      case TABLE:
        return HivePrivilegeObjectType.TABLE_OR_VIEW;
      case PARTITION:
        return HivePrivilegeObjectType.PARTITION;
      case COLUMN:
        if (SessionState.get().getAuthorizationMode() == SessionState.AuthorizationMode.V2) {
          throw new HiveException(ErrorMsg.UNSUPPORTED_AUTHORIZATION_RESOURCE_TYPE_COLUMN);
        }
        return HivePrivilegeObjectType.COLUMN;
      case DATACONNECTOR:
        return HivePrivilegeObjectType.DATACONNECTOR;
      default:
        //should not happen as we have accounted for all types
        throw new AssertionError("Unsupported type " + type);
    }
  }
Convert plugin privilege object type to thrift type
@param type
@return
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java