private void checkPartitionValues(Table tbl, int colIndex) throws HiveException {
    TypeInfo expectedType = TypeInfoUtils.getTypeInfoFromTypeString(desc.getPartKeyType());
    ObjectInspector outputOI = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(expectedType);
    Converter converter = ObjectInspectorConverters.getConverter(
        PrimitiveObjectInspectorFactory.javaStringObjectInspector, outputOI);

    List<String> partNames = context.getDb().getPartitionNames(tbl, (short) -1);
    for (String partName : partNames) {
      try {
        List<String> values = Warehouse.getPartValuesFromPartName(partName);
        String value = values.get(colIndex);
        if (value.equals(context.getConf().getVar(HiveConf.ConfVars.DEFAULT_PARTITION_NAME))) {
          continue;
        }
        Object convertedValue = converter.convert(value);
        if (convertedValue == null) {
          throw new HiveException(" Converting from " + TypeInfoFactory.stringTypeInfo + " to " + expectedType +
              " for value : " + value + " resulted in NULL object");
        }
      } catch (Exception e) {
        throw new HiveException("Exception while converting " + TypeInfoFactory.stringTypeInfo + " to " +
            expectedType + " for partition : " + partName + ", index: " + colIndex);
      }
    }
  }
Check if the existing partition values can be type casted to the new column type
with a non null value before trying to alter the partition column type.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/alter/AlterTableAlterPartitionOperation.java