private List<MDCPrivilege> listDataConnectorGrants(String dcName, String authorizer) throws Exception {
    LOG.debug("Executing listDataConnectorGrants");

    Preconditions.checkState(currentTransaction.isActive());

    dcName = normalizeIdentifier(dcName);

    final Query query;
    String[] args = null;
    final List<MDCPrivilege> mSecurityDCList;

    if (authorizer != null) {
      query = pm.newQuery(MDCPrivilege.class, "dataConnector.name == t1 && authorizer == t2");
      query.declareParameters("java.lang.String t1, java.lang.String t2");
      args = new String[] { dcName, authorizer };
    } else {
      query = pm.newQuery(MDCPrivilege.class, "dataConnector.name == t1");
      query.declareParameters("java.lang.String t1");
    }
    try (QueryWrapper wrapper = new QueryWrapper(query)) {
      if (args != null) {
        mSecurityDCList = (List<MDCPrivilege>) wrapper.executeWithArray(args);
      } else {
        mSecurityDCList = (List<MDCPrivilege>) wrapper.execute(dcName);
      }
      pm.retrieveAll(mSecurityDCList);
      LOG.debug("Done retrieving all objects for listDataConnectorGrants: {}", mSecurityDCList);
      return Collections.unmodifiableList(new ArrayList<>(mSecurityDCList));
    }
  }
Add role names of parentRoles and its parents to processedRoles
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java