@Override
      public List<Long> run(List<Long> input) throws Exception {
        int size = input.size();
        String queryText =
            "\"TBL_ID\" from \"TABLE_PARAMS\" where \"PARAM_KEY\" = 'current-snapshot-timestamp-ms' "
                + (lastUpdatedDays != null ? (" and CAST(" + dbType.toVarChar("\"PARAM_VALUE\"") + " AS decimal(21,0)) > " + (System.currentTimeMillis() - lastUpdatedDays * 24 * 3600000L)) : "")
                + " and \"TBL_ID\" in (" +  (size == 0 ? "" : repeat(",?", size).substring(1)) + ") "
                + " order by CAST(" + dbType.toVarChar("\"PARAM_VALUE\"") + " AS decimal(21,0)) DESC";
        if (tablesLimit != null && tablesLimit >= 0) {
          queryText = sqlGenerator.addLimitClause(tablesLimit, queryText);
        } else {
          queryText = "select " + queryText;
        }
        if (dbType.isMYSQL()) {
          queryText = queryText.replace("\"", "");
        }
        Object[] params = new Object[size];
        for (int i = 0; i < input.size(); ++i) {
          params[i] = input.get(i);
        }
        Deadline.checkTimeout();
        Query<?> query = pm.newQuery("javax.jdo.query.SQL", queryText);
        List<Long> ids = new ArrayList<>();
        try {
          List<Object> result = (List<Object>) query.executeWithArray(params);
          if (result != null) {
            for (Object fields : result) {
              ids.add(Long.parseLong(fields.toString()));
            }
          }
        } finally {
          query.closeAll();
        }
        return ids;
      }
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