private List<MTablePrivilege> listPrincipalAllTableGrants(String principalName, PrincipalType principalType)
      throws Exception {
    LOG.debug("Executing listPrincipalAllTableGrants");

    Preconditions.checkState(this.currentTransaction.isActive());

    try (Query query = pm.newQuery(MTablePrivilege.class, "principalName == t1 && principalType == t2")) {
      query.declareParameters("java.lang.String t1, java.lang.String t2");
      final List<MTablePrivilege> mSecurityTabPartList =
          (List<MTablePrivilege>) query.execute(principalName, principalType.toString());

      pm.retrieveAll(mSecurityTabPartList);

      LOG.debug("Done retrieving all objects for listPrincipalAllTableGrants");

      return Collections.unmodifiableList(new ArrayList<>(mSecurityTabPartList));
    }
  }
Add role names of parentRoles and its parents to processedRoles
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java