[ 
https://issues.apache.org/jira/browse/CASSANDRA-6140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylvain Lebresne updated CASSANDRA-6140:
----------------------------------------

    Attachment: 6140.txt

The problem is that there is no definitive marker for a "CQL3 table" (in 
hindsight, adding a new CQL3 ColumnFamilyType for CQL3 table would have made 
things a lot easier, but it's possibly a bit late now). So we "guess" more than 
anything else if a table is really a CQL3 one and in that case we're wrong.  
More precisely, the reason the code thinks it's a CQL3 table is because it 
looks exactly like the table that would have been defined by: {noformat}
CREATE TABLE (
  key text,
  column1 text,
  PRIMARY KEY (key, column1)
)
{noformat}

Anyway, I guess the simpler fix here is to only do validation on the thrift 
side when we're sure that the table can't have been created from thrift. That 
will be good enough in almost all cases, the case of tables having only a 
PRIMARY KEY and no other columns being the exception. Simple patch attached.


> Cassandra-cli backward compatibility issue with Cassandra 2.0.1
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-6140
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6140
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>         Environment: Linux Ubuntu, Cassandra 2.0.0
>            Reporter: DOAN DuyHai
>             Fix For: 2.0.3
>
>         Attachments: 6140.txt
>
>
> Currently we are using Cassandra 1.2.6 and we want to migrate to 2.0.1.
>  We still use Thrift for some column families (migration to CQL3 is not done 
> yet for them). We have cassandra-cli script to drop/create fresh keyspace, 
> re-create column families and populate referential data:
> *Schema creation script*
> {code}
> drop keyspace xxx;
> create keyspace xxx with placement_strategy ...
> create column family offers with 
> key_validation_class = UTF8Type and
> comparator = 'CompositeType(UTF8Type)'  and 
> default_validation_class = UTF8Type;
> {code}
> *Data insertion script*:
> {code}
> set offers['OFFER1'][PRODUCT1']='test_product';
> ...
> {code}
>  When executing the data insertion script with Cassandra 2.0.1, we have the 
> following stack trace:
> {code}
> Invalid cell for CQL3 table offers. The CQL3 column component (COL1) does not 
> correspond to a defined CQL3 column
> InvalidRequestException(why:Invalid cell for CQL3 table offers. The CQL3 
> column component (COL1) does not correspond to a defined CQL3 column)
>       at 
> org.apache.cassandra.thrift.Cassandra$insert_result$insert_resultStandardScheme.read(Cassandra.java:21447)
>       at 
> org.apache.cassandra.thrift.Cassandra$insert_result$insert_resultStandardScheme.read(Cassandra.java:21433)
>       at 
> org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:21367)
>       at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
>       at 
> org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:898)
>       at 
> org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:882)
>       at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:987)
>       at 
> org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:231)
>       at 
> org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:201)
>       at org.apache.cassandra.cli.CliMain.main(CliMain.java:327)
> {code}
>  This data insertion script works pecfectly with Cassandra 1.2.6.
>  We face the same issue with Cassandra 2.0.0. It looks like the cassandra-cli 
> commands no longer works with Cassandra 2.0.0...
>   



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to