public List<RangerPolicy> removeMultiResourcePolicies(List<RangerPolicy> rangerPolicies) {
    List<RangerPolicy> rangerPoliciesToImport = new ArrayList<RangerPolicy>();
    if (CollectionUtils.isNotEmpty(rangerPolicies)) {
      Map<String, RangerPolicy.RangerPolicyResource> rangerPolicyResourceMap = null;
      RangerPolicy.RangerPolicyResource rangerPolicyResource = null;
      List<String> resourceNameList = null;
      for (RangerPolicy rangerPolicy : rangerPolicies) {
        if (rangerPolicy != null) {
          rangerPolicyResourceMap = rangerPolicy.getResources();
          if (rangerPolicyResourceMap != null) {
            rangerPolicyResource = rangerPolicyResourceMap.get("database");
            if (rangerPolicyResource != null) {
              resourceNameList = rangerPolicyResource.getValues();
              if (CollectionUtils.isNotEmpty(resourceNameList) && resourceNameList.size() == 1) {
                rangerPoliciesToImport.add(rangerPolicy);
              }
            }
          }
        }
      }
    }
    return rangerPoliciesToImport;
  }
RangerRestClientImpl to connect to Ranger and export policies.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java