private void check(Table tbl) throws HiveException {
    assert(tbl.isPartitioned());
    try {
      int colIndex = getColumnIndex(tbl);
      checkPartitionValues(tbl, colIndex);
    } catch(Exception e) {
      throw new HiveException("Exception while checking type conversion of existing partition values to " +
          desc.getPartKeySpec() + " : " + e.getMessage());
    }
  }
Operation process of altering a partition to a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/alter/AlterTableAlterPartitionOperation.java