private static Statistics collectStatistics(HiveConf conf, PrunedPartitionList partList,
      Table table, List<ColumnInfo> schema, List<String> neededColumns, ColumnStatsList colStatsCache,
      List<String> referencedColumns) throws HiveException {

    boolean fetchColStats =
        HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_STATS_FETCH_COLUMN_STATS);
    boolean testMode =
        HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_IN_TEST);

    return collectStatistics(conf, partList, table, schema, neededColumns, colStatsCache, referencedColumns,
        fetchColStats, testMode);
  }
Collect table, partition and column level statistics
@param conf
         - hive configuration
@param partList
         - partition list
@param table
         - table
@param tableScanOperator
         - table scan operator
@return statistics object
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java