cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Patterson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-5142) ColumnFamily recreated on ALTER TABLE from CQL3
Date Tue, 15 Jan 2013 17:42:13 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-5142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13554039#comment-13554039
] 

Tyler Patterson commented on CASSANDRA-5142:
--------------------------------------------

I just tried it on osx 10.7.5 with java 1.6.0_37. The error did not happen:
{code}
[cqlsh 2.3.0 | Cassandra 1.2.0-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol 19.35.0]
Use HELP for help.
cqlsh> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor':
1};
cqlsh> USE ks;
cqlsh:ks> CREATE TABLE users (userid text, emails set <text >, firstname text, lastname
text, locations list <text >, PRIMARY KEY (userid));
cqlsh:ks> INSERT INTO users (userid, emails, firstname , lastname , locations ) VALUES
('bilbo', { 'asdf@asdf.com', 'qwer@qwer.com'}, 'bilbo', 'baggins', [ 'the shire', 'rivendale',
'lonely mountain']) ;
cqlsh:ks> INSERT INTO users (userid,  firstname , lastname , locations ) VALUES ('frodo',
'Frodo', 'Baggins', [ 'the shire', 'rivendale', 'rohan', 'mordor']) ;
cqlsh:ks> SELECT * FROM users ;

 userid | emails                         | firstname | lastname | locations
--------+--------------------------------+-----------+----------+-----------------------------------------
  bilbo | {qwer@qwer.com, asdf@asdf.com} |     bilbo |  baggins | [the shire, rivendale, lonely
mountain]
  frodo |                           null |     Frodo |  Baggins |   [the shire, rivendale,
rohan, mordor]

cqlsh:ks> ALTER TABLE users ADD todo map <timestamp, reminder_text>;
Bad Request: line 1:43 no viable alternative at input 'reminder_text'
cqlsh:ks> ALTER TABLE users ADD todo map <timestamp, text>;
cqlsh:ks> UPDATE users SET todo = { '2012-9-24' : 'enter mordor', '2012-10-2 12:00' : 'throw
ring into mount doom' } WHERE userid='frodo';
cqlsh:ks> SELECT * FROM users ;

 userid | emails                         | firstname | lastname | locations              
                | todo
--------+--------------------------------+-----------+----------+-----------------------------------------+------------------------------------------------------------------------------------------------
  bilbo | {qwer@qwer.com, asdf@asdf.com} |     bilbo |  baggins | [the shire, rivendale, lonely
mountain] |                                                                              
            null
  frodo |                           null |     Frodo |  Baggins |   [the shire, rivendale,
rohan, mordor] | {2012-09-24 00:00:00-0600: enter mordor, 2012-10-02 12:00:00-0600: throw
ring into mount doom}

{code}
                
> ColumnFamily recreated on ALTER TABLE from CQL3
> -----------------------------------------------
>
>                 Key: CASSANDRA-5142
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5142
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: MacOSX 10.8.2, Java 7u10, Cassandra 1.2.0 from brew
>            Reporter: Andrew Garman
>            Assignee: Tyler Patterson
>
> CQL session:
> ===========================
> cqlsh:demodb> SELECT * FROM users 
>  userid | emails                             | firstname | lastname | locations
> --------+------------------------------------+-----------+----------+-----------------------------------------
>   bilbo |           {bilbo10inch@wankdb.com} |     bilbo |  baggins | [the shire, rivendell,
lonely mountain]
>   frodo | {baggins@gmail.com, f@baggins.com} |     Frodo |  Baggins |   [the shire, rivendell,
rohan, mordor]
> cqlsh:demodb> ALTER TABLE users ADD todo map <timestamp, reminder_text>;
> Bad Request: Failed parsing statement: [ALTER TABLE users ADD todo map <timestamp,
reminder_text>;] reason: NullPointerException null
> cqlsh:demodb> ALTER TABLE users ADD todo map <timestamp, text>;
> cqlsh:demodb> UPDATE users 
>           ... SET todo = { '2012-9-24' : 'enter mordor',
>           ... '2012-10-2 12:00' : 'throw ring into mount doom' }
>           ... WHERE userid = 'frodo';
> cqlsh:demodb> SELECT * FROM users 
>           ... ;
>  userid | emails | firstname | lastname | locations | todo
> --------+--------+-----------+----------+-----------+------------------------------------------------------------------------------------------------
>   frodo |   null |      null |     null |      null | {2012-09-24 00:00:00-0400: enter
mordor, 2012-10-02 12:00:00-0400: throw ring into mount doom}
> ======================
> So at this point, where's my data?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message