# How to remove fields from an UDT

**URL:** <https://forum.scylladb.com/t/how-to-remove-fields-from-an-udt/442>\
**Category:** ScyllaDB\
**Created:** [April 6, 2023, 2:35pm UTC](https://forum.scylladb.com/t/how-to-remove-fields-from-an-udt/442 "2023-04-06T14:35:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![racevedoo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/racevedoo/32/91_2.png) [@racevedoo](https://forum.scylladb.com/u/racevedoo)\
**Post date:** [April 6, 2023, 2:35pm UTC](https://forum.scylladb.com/t/how-to-remove-fields-from-an-udt/442/1 "2023-04-06T14:35:22Z")

</div>

Hi everyone!

Is there any way that I can remove fields from an UDT?

Using the `superheroes` example from the [docs](https://docs.scylladb.com/stable/cql/types.html#user-defined-types), is there any way to remove the `phone` field from the `address` type?

I understand that there is no `ALTER TYPE address DROP phone` and I have also tried creating a new type without the `phone` field and running a `alter table ... alter type <new type>` but Scylla reports the types as incompatible.

In my case, I have an UDT with lots of fields and a large portion of them are not used anymore, so I’d like to just remove them. Is this possible in any way?

Thanks!

---

<div class="post-metadata">

**Author:** ![Botond\_Denes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/botond_denes/32/163_2.png) [@Botond\_Denes](https://forum.scylladb.com/u/Botond_Denes)\
**Post date:** [April 11, 2023, 6:21am UTC](https://forum.scylladb.com/t/how-to-remove-fields-from-an-udt/442/2 "2023-04-11T06:21:58Z")

</div>

We don’t support removing fields or altering fields to incompatible types because it would open pandora’s box of misery. In effect, we only allow backward compatible changes to UDT, such that reading old values of the same type, with the new definition can work.

I think the best course of action for you is to add a new field to your table, with a new UDT type and write new values to this new column. On the read side, you can check for the new column and fall back to the old one if that is missing.

You can also run a script which scans the entire table and re-writes values from the old column, into the new one, allowing you to drop the old column. This might save you some space. Unused columns in an UDT value do take up a little bit of space.

---

<div class="post-metadata">

**Author:** ![racevedoo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/racevedoo/32/91_2.png) [@racevedoo](https://forum.scylladb.com/u/racevedoo)\
**Post date:** [April 11, 2023, 10:18am UTC](https://forum.scylladb.com/t/how-to-remove-fields-from-an-udt/442/3 "2023-04-11T10:18:47Z")

</div>

Got it. Thanks for the quick answer!
