1

I have a Cassandra UDT column that has about 10 attributes and now we are planning to add 3 more attributes to it. I am wondering if it would behave well if I alter the UDT type in the higher environments which has very large volume of data.

3 Answers 3

1

Altering UDT is same as altering table, except that you cannot remove an existing UDT unless you drop all the depended tables. Also you can't alter type of a column. Below is the query how you could add new udt columnd.

alter TYPE commentmetadata ADD columnname <type>;
0

It should be safe. Just few precautions:

  1. Don't run in mixed version Cassandra cluster.
  2. Don't try to do same schema change concurrently from multiple client ( driver)
0

Additional pointers when you alter your table with UDT collections data type:

  • Never insert more than 2 billion items in a collection, as only that number can be queried.
  • The maximum number of keys for a map collection is 65,535.
  • The maximum size of an item in a list or a map collection is 2GB.
  • The maximum size of an item in a set collection is 65,535 bytes.
  • Keep collections small to prevent delays during querying.
  • Collections cannot be "sliced"; Cassandra reads a collection in its entirety, impacting performance.

Click here for more information.

[Alex Ott] MAP & LIST limits are version dependent. 65,535 bytes are supported by v3.0+ while lower versions are limited to 64,000 bytes. Fix version ticket.

1
  • 1
    sorry, but what is the point of answer? The question is about UDT, not collections... Also, limits are version dependent, and the item "The maximum size of an item in a set collection is 65,535 bytes." isn't correct in 2020th (issues.apache.org/jira/browse/CASSANDRA-10374) and it's just a error in documentation...
    – Alex Ott
    Oct 9, 2020 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.