incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Desimpel, Ignace" <Ignace.Desim...@nuance.com>
Subject Thrift execute_cql3_query function seems to require that keyspace name is lowercase and is creating keyspaces with a lower case name
Date Fri, 07 Feb 2014 13:48:55 GMT
Same for the Column Family name. I thought that CQL names were case sensitive. Also make it
impossible to use this interface to query for existing keyspaces that were created with thrift
interface and that have capitals in the name.

Did I read it wrongly?

Simple example :

String sCreateKs = "CREATE KEYSPACE KK1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor'
: 1} ";
oCqlResult = oCassClt.execute_cql3_query(ByteBuffer.wrap(sCreateKs.getBytes(UTF8)), Compression.NONE,
ConsistencyLevel.QUORUM);

//This will fail since keyspace was created with a lowercase name!!!
oCassClt.set_keyspace("KK1");

Other example :

String sCreateKs = "CREATE KEYSPACE KK1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor'
: 1} ";
oCqlResult = oCassClt.execute_cql3_query(ByteBuffer.wrap(sCreateKs.getBytes(UTF8)), Compression.NONE,
ConsistencyLevel.QUORUM);

oCassClt.set_keyspace("kk1"); //Must be in lowercase

//Will create a column family with lowercase name cc1 !!!
String sCreateColFam = "CREATE COLUMNFAMILY CC1 ( c1name text PRIMARY KEY)";
oCqlResult = oCassClt.execute_cql3_query(ByteBuffer.wrap(sCreateColFam.getBytes(UTF8)), Compression.NONE,
ConsistencyLevel.QUORUM);

Regards,

Ignace Desimpel

Mime
View raw message