Compact storage only allows one column outside of the primary key so you'll
definitely need to recreate your table if you want to add columns.
Le jeu. 18 janv. 2018 à 12:18, Nicolas Guyomar
a écrit :
> Well it should be as easy as following this :
>
Yeah, I want column4 to appear in each cell name (rather than just once)
which I think would be the same as altering the primary key.
2018-01-18 12:18 GMT+01:00 Nicolas Guyomar :
> Well it should be as easy as following this : https://docs.datastax.com/
>
Well it should be as easy as following this :
https://docs.datastax.com/en/cql/3.1/cql/cql_using/use_alter_add.html
But I'm worried that your initial requirement was to change the clustering
key, as Alexander stated, you need to create a new table and transfer your
data in it
On 18 January 2018
It was indeed created with C* 1.X
Do you have any links or otherwise on how I would add the column4? I don't
want to risk destroying my data.
Best regards,
Joel
2018-01-18 11:18 GMT+01:00 Nicolas Guyomar :
> Hi Joel,
>
> You cannot alter a table primary key.
>
> You
Hi Joel,
You cannot alter a table primary key.
You can however alter your existing table to only add column4 using cqlsh
and cql, even if this table as created back with C* 1.X for instance
On 18 January 2018 at 11:14, Joel Samuelsson
wrote:
> So to rephrase that in
Hi Joel,
Sadly it's not possible to alter the primary key of a table in Cassandra.
That would require to rewrite all data on disk to match the new
partitioning and/or clustering.
You need to create a new table and transfer all data from the old one
programmatically.
Cheers,
Le jeu. 18 janv.
So to rephrase that in CQL terms I have a table like this:
CREATE TABLE events (
key text,
column1 int,
column2 int,
column3 text,
value text,
PRIMARY KEY(key, column1, column2, column3)
) WITH COMPACT STORAGE
and I'd like to change it to:
CREATE
Hi,
I have an older system (C* 2.1) using Thrift tables on which I want to
alter a column composite. Right now it looks like (int, int, string) but I
want it to be (int, int, string, string). Is it possible to do this on a
live cluster without deleting the old data? Can you point me to some