cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tony (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-5320) Thrift is not able to use ColumnFamilies created with cqlsh 3.0
Date Fri, 08 Mar 2013 15:06:12 GMT

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

tony updated CASSANDRA-5320:
----------------------------

    Description: 
I have created a ColumnFamily with cqlsh 3.0, however this cf can not be used with thrift,
while the same cf created with cassandra-cli works with thrift.

I create the column family with cqlsh :
CREATE TABLE Persons (
  familyName varchar, 
  firstName varchar, 
  address varchar,
  PRIMARY KEY(familyName));

And in java code :

        Cluster cluster = HFactory.getOrCreateCluster("Test Cluster","localhost:9160");  
     
        Keyspace keyspace = HFactory.createKeyspace("customerdemo", cluster);
        StringSerializer stringSerializer = StringSerializer.get();
        Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
        mutator.insert("jsmith", "Persons", HFactory.createStringColumn("first", "John"));

The result is :
Caused by: InvalidRequestException(why:unconfigured columnfamily Personbis)
	at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20350)

The same column family works with thrift when created through cassandra-cli :
CREATE COLUMN FAMILY Persons
 WITH comparator = UTF8Type 
 AND key_validation_class=UTF8Type 
 AND column_metadata = [
  {column_name:familyName, validation_class: UTF8Type}
  {column_name:firstName, validation_class: UTF8Type}
  {column_name:address, validation_class: UTF8Type}
];

Java code result :
It works.

  was:
I have created a ColumnFamily with cqlsh, however this cf can not be used with thrift, while
the same cf created with cassandra-cli works with thrift.

I create the column family with cqlsh :
CREATE TABLE Persons (
  familyName varchar, 
  firstName varchar, 
  address varchar,
  PRIMARY KEY(familyName));

And in java code :

        Cluster cluster = HFactory.getOrCreateCluster("Test Cluster","localhost:9160");  
     
        Keyspace keyspace = HFactory.createKeyspace("customerdemo", cluster);
        StringSerializer stringSerializer = StringSerializer.get();
        Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
        mutator.insert("jsmith", "Persons", HFactory.createStringColumn("first", "John"));

The result is :
Caused by: InvalidRequestException(why:unconfigured columnfamily Personbis)
	at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20350)

The same column family works with thrift when created through cassandra-cli :
CREATE COLUMN FAMILY Persons
 WITH comparator = UTF8Type 
 AND key_validation_class=UTF8Type 
 AND column_metadata = [
  {column_name:familyName, validation_class: UTF8Type}
  {column_name:firstName, validation_class: UTF8Type}
  {column_name:address, validation_class: UTF8Type}
];

Java code result :
It works.

    
> Thrift is not able to use ColumnFamilies created with cqlsh 3.0
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-5320
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5320
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>         Environment: Hector 1.1-3
>            Reporter: tony
>            Priority: Minor
>
> I have created a ColumnFamily with cqlsh 3.0, however this cf can not be used with thrift,
while the same cf created with cassandra-cli works with thrift.
> I create the column family with cqlsh :
> CREATE TABLE Persons (
>   familyName varchar, 
>   firstName varchar, 
>   address varchar,
>   PRIMARY KEY(familyName));
> And in java code :
>         Cluster cluster = HFactory.getOrCreateCluster("Test Cluster","localhost:9160");
       
>         Keyspace keyspace = HFactory.createKeyspace("customerdemo", cluster);
>         StringSerializer stringSerializer = StringSerializer.get();
>         Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
>         mutator.insert("jsmith", "Persons", HFactory.createStringColumn("first", "John"));
> The result is :
> Caused by: InvalidRequestException(why:unconfigured columnfamily Personbis)
> 	at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20350)
> The same column family works with thrift when created through cassandra-cli :
> CREATE COLUMN FAMILY Persons
>  WITH comparator = UTF8Type 
>  AND key_validation_class=UTF8Type 
>  AND column_metadata = [
>   {column_name:familyName, validation_class: UTF8Type}
>   {column_name:firstName, validation_class: UTF8Type}
>   {column_name:address, validation_class: UTF8Type}
> ];
> Java code result :
> It works.

--
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