private Map<Long, String> getParamValues(Connection dbConn, List<Long> partIdList) throws SQLException {
    List<String> queries = new ArrayList<>();
    StringBuilder prefix = new StringBuilder();
    StringBuilder suffix = new StringBuilder();

    prefix.append("select \"PART_ID\", \"PARAM_VALUE\" "
            + " from \"PARTITION_PARAMS\" where "
            + " \"PARAM_KEY\" = 'COLUMN_STATS_ACCURATE' "
            + " and ");
    TxnUtils.buildQueryWithINClause(conf, queries, prefix, suffix,
            partIdList, "\"PART_ID\"", true, false);

    Map<Long, String> partIdToParaMap = new HashMap<>();
    try (Statement statement = dbConn.createStatement()) {
      for (String query : queries) {
        LOG.debug("Execute query: " + query);
        try (ResultSet rs = statement.executeQuery(query)) {
          while (rs.next()) {
            partIdToParaMap.put(rs.getLong(1), rs.getString(2));
          }
        }
      }
    }

    return partIdToParaMap;
  }
This class contains the optimizations for MetaStore that rely on direct SQL access to
the underlying database. It should use ANSI SQL and be compatible with common databases
such as MySQL (note that MySQL doesn't use full ANSI mode by default), Postgres, etc.

This class separates out the update part from MetaStoreDirectSql class.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdatePart.java