You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Vivek Mishra <mi...@gmail.com> on 2012/10/09 03:59:02 UTC

Using Composite columns

Hi,
I am trying to use compound primary key with cassandra and i am referring
to:
http://www.datastax.com/dev/blog/whats-new-in-cql-3-0

I have created a column family as:

CREATE TABLE altercations (
       instigator text,
       started_at timestamp,
       ships_destroyed int,
       energy_used float,
       alliance_involvement boolean,
       PRIMARY KEY (instigator, started_at)
   );


then tried:

cqlsh:testcomp> select * from altercations;

(gives me no results, Which looks fine).

Then i tried insert statement as:

 INSERT INTO altercations (instigator, started_at, ships_destroyed,
                             energy_used, alliance_involvement)
                     VALUES ('Jayne Cobb', '7943-07-23', 2, 4.6, 'false');

(Sucess with this)

Then again i tried:

cqlsh:testcomp> select * from altercations;

it is giving me an error:

[timestamp out of range for platform time_t]


I am able to get that work by changing '7943-07-23' to '2012-07-23'.

Just wanted to know, why cassandra does not complain for {timestamp
out of range for platform time_t} at the time of persisting it?


-Vivek

Re: Using Composite columns

Posted by Sylvain Lebresne <sy...@datastax.com>.
Yeah, you might want to check 1.1.5, 1.1.2 is sooooo ancient :)

--
Sylvain

On Tue, Oct 9, 2012 at 9:44 AM, Vivek Mishra <mi...@gmail.com> wrote:
> I am trying it with 1.1.2 cassandra release.
>
> -Vivek
>
>
> On Tue, Oct 9, 2012 at 1:13 PM, Sylvain Lebresne <sy...@datastax.com>
> wrote:
>>
>> On Tue, Oct 9, 2012 at 3:59 AM, Vivek Mishra <mi...@gmail.com>
>> wrote:
>> > it is giving me an error:
>> >
>> > [timestamp out of range for platform time_t]
>>
>> Hum, I can't reproduce that with the current 1.1 branch (nor in
>> trunk). So my bet is that this was an error from cqlsh that has been
>> fixed recently. A quick JIRA search haven't allowed me to find the
>> corresponding issue however.
>>
>> --
>> Sylvain
>
>

Re: Using Composite columns

Posted by Vivek Mishra <mi...@gmail.com>.
I am trying it with 1.1.2 cassandra release.

-Vivek

On Tue, Oct 9, 2012 at 1:13 PM, Sylvain Lebresne <sy...@datastax.com>wrote:

> On Tue, Oct 9, 2012 at 3:59 AM, Vivek Mishra <mi...@gmail.com>
> wrote:
> > it is giving me an error:
> >
> > [timestamp out of range for platform time_t]
>
> Hum, I can't reproduce that with the current 1.1 branch (nor in
> trunk). So my bet is that this was an error from cqlsh that has been
> fixed recently. A quick JIRA search haven't allowed me to find the
> corresponding issue however.
>
> --
> Sylvain
>

Re: Using Composite columns

Posted by Sylvain Lebresne <sy...@datastax.com>.
On Tue, Oct 9, 2012 at 3:59 AM, Vivek Mishra <mi...@gmail.com> wrote:
> it is giving me an error:
>
> [timestamp out of range for platform time_t]

Hum, I can't reproduce that with the current 1.1 branch (nor in
trunk). So my bet is that this was an error from cqlsh that has been
fixed recently. A quick JIRA search haven't allowed me to find the
corresponding issue however.

--
Sylvain