@Override
  public boolean connect(StatsCollectionContext scc) {
    errorMethod = HiveConf.getVar(scc.getHiveConf(), HiveConf.ConfVars.HIVE_TEST_MODE_DUMMY_STAT_AGGR);
    if (errorMethod.equalsIgnoreCase("connect")) {
      return false;
    }

    return true;
  }
An test implementation for StatsAggregator.
The method corresponding to the configuration parameter
hive.test.dummystats.aggregator fail, whereas all
other methods succeed.
itests/util/src/main/java/org/apache/hadoop/hive/ql/stats/DummyStatsAggregator.java