private List<Partition> getPartitionsByNames(String catName, String dbName,
      String tblName, List<String> partNameList, boolean isAcidTable, GetPartitionsArgs args)
      throws MetaException {
    // Get most of the fields for the partNames provided.
    // Assume db and table names are the same for all partition, as provided in arguments.
    String quotedPartNames = partNameList.stream()
        .map(DirectSqlUpdatePart::quoteString)
        .collect(Collectors.joining(","));

    String queryText =
        "select " + PARTITIONS + ".\"PART_ID\"," + SDS + ".\"SD_ID\"," + SDS + ".\"CD_ID\","
        + SERDES + ".\"SERDE_ID\"," + PARTITIONS + ".\"CREATE_TIME\"," + PARTITIONS
        + ".\"LAST_ACCESS_TIME\"," + SDS + ".\"INPUT_FORMAT\"," + SDS + ".\"IS_COMPRESSED\","
        + SDS + ".\"IS_STOREDASSUBDIRECTORIES\"," + SDS + ".\"LOCATION\"," + SDS
        + ".\"NUM_BUCKETS\"," + SDS + ".\"OUTPUT_FORMAT\"," + SERDES + ".\"NAME\","
        + SERDES + ".\"SLIB\"," + PARTITIONS + ".\"WRITE_ID\"" + " from " + PARTITIONS
        + " left outer join " + SDS + " on " + PARTITIONS + ".\"SD_ID\" = " + SDS + ".\"SD_ID\" "
        + " left outer join " + SERDES + " on " + SDS + ".\"SERDE_ID\" = " + SERDES + ".\"SERDE_ID\" "
        + " inner join " + TBLS + " on " + TBLS + ".\"TBL_ID\" = " + PARTITIONS + ".\"TBL_ID\" "
        + " inner join " + DBS + " on " + DBS + ".\"DB_ID\" = " + TBLS + ".\"DB_ID\" "
        + " where \"PART_NAME\" in (" + quotedPartNames + ") "
        + " and " + TBLS + ".\"TBL_NAME\" = ? and " + DBS + ".\"NAME\" = ? and " + DBS
        + ".\"CTLG_NAME\" = ? order by \"PART_NAME\" asc";

    Object[] params = new Object[]{tblName, dbName, catName};
    return getPartitionsByQuery(catName, dbName, tblName, queryText, params, isAcidTable, args);
  }
Should be called with the list short enough to not trip up Oracle/etc.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java