public static StorageSegment alterColumn(String name,
                                             StorageSegment baseSegment,
                                             List<UpdateColSchema> alterColumnSchema,
                                             Path storePath) throws IOException {
        validateSchema(alterColumnSchema);

        List<UpdateColSchema> targetColumns = new ArrayList<>();
        boolean update = false;
        for (ColumnSchema cs : baseSegment.schema().getColumns()) {
            int idx = indexWhere(alterColumnSchema, c -> c.name.equals(cs.getName()));
            if (idx < 0) {
                // Keep untouch.
                targetColumns.add(new UpdateColSchema(cs.getName(), cs.getSqlType(), cs.isIndexed(), cs.getName()));
            } else {
                targetColumns.add(alterColumnSchema.get(idx));
                update = true;
            }
        }
        if (!update) {
            return baseSegment;
        }

        return newColumnSchema(name, baseSegment, targetColumns, storePath);
    }
Alter columns in this segment, including the dataType and the value. Those nonexsitent columns will be ignored.

@return the new segment. If nothing is changed, returns the original segment instance.
indexr-segment/src/main/java/io/indexr/segment/storage/UpdateColSegment.java