问题
I have created a table my_table
with a column phone
, which has been declared as of type varint.
After entering some data, I realized that it would have been better if I had declared this column as list<int>.
I tried to:
ALTER TABLE my_table
ALTER phone TYPE list<int>
but unfortunately I am not allowed to do so. Hopefully, there is a way to make this change.
UPDATE: Assume that I make a new column phonelist
of type list<int>
. Is there any efficient way to move the data in the phone
column into the phonelist
column?
回答1:
You cannot change the type of an existing column to a map or collection.
The table shows the allowed alterations for data types
来源:https://stackoverflow.com/questions/39203542/change-the-type-of-a-column-in-cassandra