// manufacture a StatsAggregator
StatsAggregator statsAggregator;
String statsImplementationClass = HiveConf.getVar(conf, HiveConf.ConfVars.HIVESTATSDBCLASS);
StatsFactory.setImplementation(statsImplementationClass, conf);
statsAggregator = StatsFactory.getStatsAggregator();
if (!statsAggregator.connect(conf)) {
// this should not fail the whole job, return 0 so that the job won't fail.
console.printInfo("[WARNING] Could not update table/partition level stats.",
"StatsAggregator.connect() failed: stats class = " +
statsImplementationClass);
return 0;