On Wed, Nov 27, 2013 at 7:06 PM, Jacob Edelstein <ja...@curalate.com> wrote:

> Hi all,
> We made a decision to use compact storage for a couple of very large
> tables to get maximum storage efficiency. We understood that this would
> limit us to a single non-primary key column. We did not realize at the time
> that we would not be able to add this column using the cql3 alter command.
> This is well documented, but we just missed it. I have a few questions:
>
> 1. Is there any way to add this column without using the cql3 alter
> command? We want to add a boolean column to the table below. The new column
> will not be part of the primary key.
>
> create table no_extra_column (
>   a varchar,
>   b timestamp,
>   c varchar,
>   PRIMARY KEY (a, b, c)
> ) WITH COMPACT STORAGE and
> compaction={'class':'LeveledCompactionStrategy'};
>

So you mean that you currently have no PK columns at all and want to add
one? If so, it's "possible" because COMPACT STORAGE can support one non-PK
column and you have none, but it will involve messing with the underlying
schema manually and is not "supported" per se (it's black magic territory).
Might be worth asking yourself the question "might I need more than one
column later on"? If you suspect you may, migrating to a non compact table
could be worth the trouble. Just saying.

Anyway, if you feel like going through the route of manually modifying your
schema, I can tell you what you can try but:
1) I'd need to know which version of C* you use (at least whether it's 1.2
or 2.0 but the exact version can't hurt).
2) I make no guarantee your datacenters won't be reduced to dust following
those manipulations. Messing with the black arts has great powers but is
dangerous.

--
Sylvain

Reply via email to