@Override
  public List<List<ColumnStatistics>> getPartitionColumnStatistics(String catName, String dbName, String tableName,
      List<String> partNames, List<String> colNames) throws MetaException, NoSuchObjectException {
    // Note: this will get stats without verifying ACID.
    boolean committed = false;
    Query query = null;
    List<List<ColumnStatistics>> result = new ArrayList<>();

    try {
      openTransaction();
      query = pm.newQuery(MPartitionColumnStatistics.class);
      query.setFilter("partition.table.tableName == t1 && partition.table.database.name == t2 && partition.table.database.catalogName == t3");
      query.declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3");
      query.setResult("DISTINCT engine");
      Collection names = (Collection) query.execute(tableName, dbName, catName);
      List<String> engines = new ArrayList<>();
      for (Iterator i = names.iterator(); i.hasNext();) {
        engines.add((String) i.next());
      }
      for (String e : engines) {
        List<ColumnStatistics> cs = getPartitionColumnStatisticsInternal(
            catName, dbName, tableName, partNames, colNames, e, true, true);
        if (cs != null) {
          result.add(cs);
        }
      }
      committed = commitTransaction();
      return result;
    } finally {
      LOG.debug("Done executing getTableColumnStatistics with status : {}",
          committed);
      rollbackAndCleanup(committed, query);
    }
  }
@Test
  public void testGetPartitionStatistics() throws Exception {
    createPartitionedTable(true, true);

    List<List<ColumnStatistics>> stat;
    try (AutoCloseable c = deadline()) {
      stat = objectStore.getPartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          Arrays.asList("test_part_col=a0", "test_part_col=a1", "test_part_col=a2"),
          Collections.singletonList("test_part_col"));
    }

    Assert.assertEquals(1, stat.size());
    Assert.assertEquals(3, stat.get(0).size());
    Assert.assertEquals(ENGINE, stat.get(0).get(0).getEngine());
    Assert.assertEquals(1, stat.get(0).get(0).getStatsObj().size());

    ColumnStatisticsData computedStats = stat.get(0).get(0).getStatsObj().get(0).getStatsData();
    ColumnStatisticsData expectedStats = new ColStatsBuilder<>(long.class).numNulls(1).numDVs(2)
        .low(3L).high(4L).hll(3, 4).kll(3, 4).build();
    assertEqualStatistics(expectedStats, computedStats);
  }