private String genRewrittenQuery(List<String> colNames, List<String> colTypes, HiveConf conf,
      List<TransformSpec> partTransformSpec, int specId, Map<String, String> partSpec, 
      boolean isPartitionStats) {
    String rewritten = genRewrittenQuery(tbl, colNames, colTypes, conf, partTransformSpec, specId, partSpec, 
        isPartitionStats, false);
    isRewritten = true;
    return rewritten;
  }
ColumnStatsSemanticAnalyzer.
Handles semantic analysis and rewrite for gathering column statistics both at the level of a
partition and a table. Note that table statistics are implemented in SemanticAnalyzer.
ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsSemanticAnalyzer.java