I have a Cassandra UDT column that has about 10 attributes and now we are planning to add 3 more attributes to it. What is the query to add all the three attributes. I can add them one by one by executing 3 different queries like alter TYPE commentmetadata ADD columnname1 <type>;
, alter TYPE commentmetadata ADD columnname2 <type>;
, alter TYPE commentmetadata ADD columnname3 <type>;
.
Can this is be done in a single query? Datastax documentation mentions that it can be done by something like this ALTER TYPE commentmetadata ADD (field_name cql_datatype[,...])
add fields by entering a field name followed by the data type in a comma separated list.
I tried the following 3 queries but I am getting query error for all.
ALTER TYPE commentmetadata ADD columnname1 int, columnname2 int, columnname3 int;
ALTER TYPE commentmetadata ADD [columnname1 int, columnname2 int, columnname3 int];
ALTER TYPE commentmetadata ADD (columnname1 int, columnname2 int, columnname3 int);