incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gareth Collins <gareth.o.coll...@gmail.com>
Subject Re: CQL3 And ReversedTypes Question
Date Sat, 13 Apr 2013 04:40:03 GMT
OK, trying out 1.2.4. The previous issue seems to be fine, but I am
experiencing a new one:

cqlsh:location> create table test_y (message_id timeuuid, name text,
PRIMARY KEY (name,message_id));
cqlsh:location> insert into test_y (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_y (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_y (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_y (message_id,name) VALUES (now(),'foo');
cqlsh:location> select dateOf(message_id) from test_y;

 dateOf(message_id)
--------------------------
 2013-04-13 00:33:42-0400
 2013-04-13 00:33:43-0400
 2013-04-13 00:33:43-0400
 2013-04-13 00:33:44-0400

cqlsh:location> create table test_x (message_id timeuuid, name text,
PRIMARY KEY (name,message_id)) WITH CLUSTERING ORDER BY (message_id DESC);
cqlsh:location> insert into test_x (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_x (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_x (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_x (message_id,name) VALUES (now(),'foo');
cqlsh:location> insert into test_x (message_id,name) VALUES (now(),'foo');
cqlsh:location> select dateOf(message_id) from test_x;
Bad Request: Type error:
org.apache.cassandra.cql3.statements.Selection$SimpleSelector@1e7318 cannot
be passed as argument 0 of function dateof of type timeuuid

Is there something I am missing here or should I open a new ticket?

thanks in advance,
Gareth


On Tue, Mar 26, 2013 at 3:30 PM, Gareth Collins
<gareth.o.collins@gmail.com>wrote:

> Added:
>
> https://issues.apache.org/jira/browse/CASSANDRA-5386
>
> Thanks very much for the quick answer!
>
> regards,
> Gareth
>
> On Tue, Mar 26, 2013 at 3:55 AM, Sylvain Lebresne <sylvain@datastax.com>
> wrote:
> > You aren't missing anything obvious. That's a bug really. Would you mind
> > opening a ticket on https://issues.apache.org/jira/browse/CASSANDRA?
> >
> > --
> > Sylvain
> >
> >
> > On Tue, Mar 26, 2013 at 2:48 AM, Gareth Collins <
> gareth.o.collins@gmail.com>
> > wrote:
> >>
> >> Hi,
> >>
> >> I created a table with the following structure in cqlsh (Cassandra
> >> 1.2.3 - cql 3):
> >>
> >> CREATE TABLE mytable ( column1 text,
> >>       column2 text,
> >>       messageId timeuuid,
> >>       message blob,
> >>       PRIMARY KEY ((column1, column2), messageId));
> >>
> >> I can quite happily add values to this table. e.g:
> >>
> >> insert into client_queue (column1,column2,messageId,message) VALUES
> >> ('string1','string2',now(),'ABCCDCC123');
> >>
> >> Yet if I decide I want to set the clustering order on messageId DESC:
> >>
> >> CREATE TABLE mytable ( column1 text,
> >>       column2 text,
> >>       messageId timeuuid,
> >>       message blob,
> >>       PRIMARY KEY ((column1, column2), messageId)) WITH CLUSTERING
> >> ORDER BY (messageId DESC);
> >>
> >> and try to do an insert:
> >>
> >> insert into client_queue2 (column1,column2,messageId,message) VALUES
> >> ('string1','string2',now(),'ABCCDCC123');
> >>
> >> I get the following error:
> >>
> >> Bad Request: Type error: cannot assign result of function now (type
> >> timeuuid) to messageid (type
> >>
> >>
> 'org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType)')
> >>
> >> I am sure I am missing something obvious here, but I don't understand.
> >> Why am I getting an error? What do I need
> >> to do to be able to add an entry to this table?
> >>
> >> thanks in advance,
> >> Gareth
> >
> >
>

Mime
View raw message