cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean Carlo <jean.jeancar...@gmail.com>
Subject Re: Migration from 2.0.10 to 2.1.12
Date Wed, 30 Mar 2016 13:41:12 GMT
Yes we did some reads and writes, the problem is that adding double quotes
force us to modify our code to change and insert like that

INSERT INTO table1 (bill_id, *full*, name,provider_date ,total) values
('qs','full','name','2015-02-23','toltal');

to this

INSERT INTO table1 (bill_id, *"full"*, name,provider_date ,total) values
('qs','full','name','2015-02-23','toltal');

this last one is ok, but obviously the first one makes an error:

cqlsh:pns_fr_2_jean> INSERT INTO table1 (bill_id, full, name,provider_date
,total) values ('qs','full','name','2015-02-23','toltal');
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query]
message="line 1:29 no viable alternative at input '*full*' (INSERT INTO
table1 (bill_id, [full]...)">

and it is because the name of the column is not longer full, is "full"



Best regards

Jean Carlo

"The best way to predict the future is to invent it" Alan Kay

On Wed, Mar 30, 2016 at 3:26 PM, Eric Evans <eevans@wikimedia.org> wrote:

> On Wed, Mar 30, 2016 at 8:08 AM, Jean Carlo <jean.jeancarl48@gmail.com>
> wrote:
> > With double quotes it doesn't show error
> >
> > CREATE TABLE table1 (     bill_id text,     "full" text,     name text,
> > provider_date timestamp,     total text,     PRIMARY KEY ( bill_id) ) ;
> >
> > but it changes the name of the column
>
> I don't think it does though; You're meant to be able to use the
> output of DESC TABLE to (re)create these tables, so it's quoted below
> for the same reason you did so above.
>
> Obviously it would be better to have column names that parse without
> needing to be double quoted, but it should work.  Have you tried some
> reads and writes?
>
> > desc table table1;
> >
> > CREATE TABLE pns_fr_2_jean.table1 (
> >     bill_id text PRIMARY KEY,
> >     "full" text,
> >     name text,
> >     provider_date timestamp,
> >     total text
> > )
> >
> > instead of
> >
> > CREATE TABLE pns_fr_2_jean.table1 (
> >     bill_id text PRIMARY KEY,
> >     full text,
> >     name text,
> >     provider_date timestamp,
> >     total text
> > )
>
>
> --
> Eric Evans
> eevans@wikimedia.org
>

Mime
View raw message