private List<MTableColumnStatistics> getMTableColumnStatistics(Table table, List<String> colNames, String engine)
      throws MetaException {

    Preconditions.checkState(this.currentTransaction.isActive());

    if (colNames.isEmpty()) {
      return Collections.emptyList();
    }

    boolean committed = false;
    try {
      openTransaction();

      validateTableCols(table, colNames);

      List<MTableColumnStatistics> result = Collections.emptyList();
      try (Query query = pm.newQuery(MTableColumnStatistics.class)) {
      result =
          Batchable.runBatched(batchSize, colNames, new Batchable<String, MTableColumnStatistics>() {
            @Override
            public List<MTableColumnStatistics> run(List<String> input)
                throws MetaException {
              StringBuilder filter =
                  new StringBuilder("table.tableName == t1 && table.database.name == t2 && table.database.catalogName == t3 && engine == t4 && (");
              StringBuilder paramStr = new StringBuilder(
                  "java.lang.String t1, java.lang.String t2, java.lang.String t3, java.lang.String t4");
              Object[] params = new Object[input.size() + 4];
              params[0] = table.getTableName();
              params[1] = table.getDbName();
              params[2] = table.getCatName();
              params[3] = engine;
              for (int i = 0; i < input.size(); ++i) {
                filter.append((i == 0) ? "" : " || ").append("colName == c").append(i);
                paramStr.append(", java.lang.String c").append(i);
                params[i + 4] = input.get(i);
              }
              filter.append(")");
              query.setFilter(filter.toString());
              query.declareParameters(paramStr.toString());
              List<MTableColumnStatistics> paritial = (List<MTableColumnStatistics>) query.executeWithArray(params);
              pm.retrieveAll(paritial);
              return paritial;
            }
          });

      if (result.size() > colNames.size()) {
        throw new MetaException("Unexpected " + result.size() + " statistics for "
            + colNames.size() + " columns");
      }
      result = new ArrayList<>(result);
      }
      committed = commitTransaction();
      return result;
    } catch (Exception ex) {
      LOG.error("Error retrieving statistics via jdo", ex);
      if (ex instanceof MetaException) {
        throw (MetaException) ex;
      }
      throw new MetaException(ex.getMessage());
    } finally {
      rollbackAndCleanup(committed, null);
    }
  }
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