private List<MPartitionColumnStatistics> getMPartitionColumnStatistics(Table table, List<String> partNames,
      List<String> colNames, String engine) throws MetaException {
    boolean committed = false;

    try {
      openTransaction();
      // We are not going to verify SD for each partition. Just verify for the
      // table. TODO: we need verify the partition column instead
      try {
        validateTableCols(table, colNames);
      } catch (MetaException me) {
        LOG.warn("The table does not have the same column definition as its partition.");
      }
      List<MPartitionColumnStatistics> result = Collections.emptyList();
      try (Query query = pm.newQuery(MPartitionColumnStatistics.class)) {
        String paramStr = "java.lang.String t1, java.lang.String t2, java.lang.String t3, java.lang.String t4";
        String filter = "partition.table.tableName == t1 && partition.table.database.name == t2 && partition.table.database.catalogName == t3 && engine == t4 && (";
        Object[] params = new Object[colNames.size() + partNames.size() + 4];
        int i = 0;
        params[i++] = table.getTableName();
        params[i++] = table.getDbName();
        params[i++] = table.isSetCatName() ? table.getCatName() : getDefaultCatalog(conf);
        params[i++] = engine;
        int firstI = i;
        for (String s : partNames) {
          filter += ((i == firstI) ? "" : " || ") + "partition.partitionName == p" + i;
          paramStr += ", java.lang.String p" + i;
          params[i++] = s;
        }
        filter += ") && (";
        firstI = i;
        for (String s : colNames) {
          filter += ((i == firstI) ? "" : " || ") + "colName == c" + i;
          paramStr += ", java.lang.String c" + i;
          params[i++] = s;
        }
        filter += ")";
        query.setFilter(filter);
        query.declareParameters(paramStr);
        query.setOrdering("partition.partitionName ascending");
        result = (List<MPartitionColumnStatistics>) query.executeWithArray(params);
        pm.retrieveAll(result);
        result = new ArrayList<>(result);
      } catch (Exception ex) {
        LOG.error("Error retrieving statistics via jdo", ex);
        throw new MetaException(ex.getMessage());
      }
      committed = commitTransaction();
      return result;
    } finally {
      if (!committed) {
        rollbackTransaction();
        return Collections.emptyList();
      }
    }
  }
Get partition's column stats

@return Map of column name and its stats
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java