public List<MetadataTableSummary> getMetadataSummary(String catalogFilter,
      String dbFilter, String tableFilter) throws MetaException {
    Set<Long> partedTabs = new HashSet<>();
    Set<Long> nonPartedTabs = new HashSet<>();
    Map<Long, MetadataTableSummary> summaries = new HashMap<>();
    List<MetadataTableSummary> metadataTableSummaryList = new ArrayList<>();
    StringBuilder filter = new StringBuilder();
    List<String> parameterVals = new ArrayList<>();
    if (!StringUtils.isEmpty(dbFilter)) {
      appendPatternCondition(filter, "database.name", dbFilter, parameterVals);
    }
    if (!StringUtils.isEmpty(tableFilter)) {
      appendPatternCondition(filter, "tableName", tableFilter, parameterVals);
    }
    try (QueryWrapper query = new QueryWrapper(filter.length() > 0 ?
        pm.newQuery(MTable.class, filter.toString()) : pm.newQuery(MTable.class))){
      query.setResult("id, database.catalogName, database.name, tableName, owner, tableType");
      List<Object[]> tables = (List<Object[]>) query.executeWithArray(parameterVals.toArray(new String[0]));
      for (Object[] table : tables) {
        Deadline.checkTimeout();
        long tableId = Long.parseLong(table[0].toString());
        MetadataTableSummary summary = new MetadataTableSummary(String.valueOf(table[1]),
            String.valueOf(table[2]), String.valueOf(table[3]), String.valueOf(table[4]));
        summary.setTableType(String.valueOf(table[5]));
        summary.setTableId(tableId);
        summaries.put(tableId, summary);
        metadataTableSummaryList.add(summary);
      }
    }
    collectColumnSummary(summaries);
    collectTabFormatSummary(summaries);
    collectPartitionSummary(summaries, partedTabs, nonPartedTabs);
    collectBasicStats(summaries, nonPartedTabs, partedTabs);
    return metadataTableSummaryList;
  }
Using resultSet to read the HMS_SUMMARY table.
@param catalogFilter the optional catalog name filter
@param dbFilter the optional database name filter
@param tableFilter the optional table name filter
@return MetadataSummary
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/MetaToolObjectStore.java