private static String getColTypeOf(Table tbl, String partKey) {
    for (FieldSchema fs : tbl.hasNonNativePartitionSupport() ?
          tbl.getStorageHandler().getPartitionKeys(tbl) : tbl.getPartitionKeys()) {
      if (partKey.equalsIgnoreCase(fs.getName())) {
        return fs.getType().toLowerCase();
      }
    }
    throw new RuntimeException("Unknown partition key : " + partKey);
  }
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