Cassandra でテーブルの列の型を変更するのに問題があります。
これは、列が PRIMARY KEY の一部ではなく、INDEX がない場合に型を変更できるというドキュメントへのリンクです。私はそれを機能させることができません。
cqlsh:test> show VERSION
[cqlsh 3.1.8 | Cassandra 1.2.13 | CQL spec 3.0.0 | Thrift protocol 19.36.2]
CREATE TABLE mytable (
id1 text,
id2 text,
col1 int,
col2 bigint,
col3 text,
PRIMARY KEY (id1, id2)
) WITH CLUSTERING ORDER BY (id2 DESC);
UPDATE mytable SET col1 = 123, col2 = 1234, col3 = '12345' WHERE id1 = 'id1' AND id2 = 'id2';
SELECT * FROM mytable ;
id1 | id2 | col1 | col2 | col3
-----+-----+------+------+-------
id1 | id2 | 123 | 1234 | 12345
列のタイプを変更しようとすると、エラーが発生します。
ALTER TABLE mytable ALTER col1 TYPE text;
Bad Request: Cannot change col1 from type int to type text: types are incompatible.
ALTER TABLE mytable ALTER col1 TYPE text;
Bad Request: Cannot change col1 from type int to type text: types are incompatible.
ALTER TABLE mytable ALTER col2 TYPE text;
Bad Request: Cannot change col2 from type bigint to type text: types are incompatible.
ALTER TABLE mytable ALTER col3 TYPE bigint;
Bad Request: Cannot change col3 from type text to type bigint: types are incompatible.
ALTER TABLE mytable ALTER col3 TYPE int;
Bad Request: Cannot change col3 from type text to type int: types are incompatible.
私は何が欠けているか、間違っていますか? どんな助けでも大歓迎です。