I have a large table in Cassandra with a column of type int but no values are outside the range 0-10. I want to reduce the table size by changing the type of the column to tinyint.
This is the error I get
[Query invalid because of configuration issue] message="Cannot change COLUMN_NAME from type int to type tinyint: types are not order-compatible.">
Is there a nice way to handle this with a cast or other such query trickery?
If not ... and without taking the database down, is there a better way to solve this than doing the following?
- make a new column of type tinyint
- update my code to duplicate data to this column during write operations
- copy old data to the new column [will take a while probably]
- swap the names of the columns
- revert my code change (only update one column)
- delete the old int column