incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Using compound primary key
Date Tue, 09 Oct 2012 07:46:59 GMT
On Tue, Oct 9, 2012 at 8:57 AM, Vivek Mishra <mishra.vivs@gmail.com> wrote:
> Ok. I am able to understand the problem now. Issue is:
>
> If i create a column family altercations as:
>
> **********************************************************************************************************8
> CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>    );
> /
>    INSERT INTO altercations (instigator, started_at, ships_destroyed,
>                              energy_used, alliance_involvement)
>                      VALUES ('Jayne Cobb', '2012-07-23', 2, 4.6, 'false');
> *********************************************************************************************************************
>
> it works!
>
> But if i create a column family with compound primary key with 2 composite
> column as:
>
> CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at)
>    );
>
> *********************************************************************************************************************
> and Then drop this column family:
>
> drop columnfamily altercations;
>
> and then try to create same one with primary compound key with 3 composite
> column:
>
> CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>    );
>
> it gives me error: "TSocket read 0 bytes"
>
> Rest, as no column family is created, so nothing onwards will work.
>
> Is this an issue?

Sounds like it yes (I mean the theory is, you shouldn't ever get such
an error by creating and dropping tables. Even if you do something
wrong, you should get a meaningful error).

Is there an exception in the log server side? (it's often the case
with a "TSocket read 0 bytes").

--
Sylvain

Mime
View raw message